Hazrat Imam Mahdi (as) bears the special characteristics and more from the previous prophets. He is the embodiment of their virtues and qualities. He carries their signs and is the inheritor of all that they stood for and what was revealed upon them. The following article mentions the similarity between Hazrat Daniyal (as) and Imam Mahdi (as).
Hazrat Daniyal (as) remained in occultation for a period of time from Bani Israel. And they had imprisoned him in a huge pit along with a man-eater lion so that it makes a morsel of him. Almighty Allah protected him and ordered a prophet of Bani Israel to convey food and water to him. And his followers and Shias fell into severe hardships.
Imam Mahdi (as) remains in occultation from our sight and due to his occultation our hardships have multiplied. And as we have explained before, the enemies of His Eminence wanted to eliminate him but the Almighty Allah protected and guarded him.
(The above article was taken and adapted from the book Mikyalul Makarim Fee Fawaedid Dua Lil Qaem)