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 Yusha (as) and Imam Mahdi (as).
After the passing away of Musa (as) the hypocrites of the community fought with Yusha (as).
Imam Mahdi (as) would also be such that the hypocrites of this community would fight him
The sun had risen up again for Yusha (as). Imam Mahdi (as) will speak to the sun and the moon and he would call out to them. And they shall reply to him. As Allamah Majlisi has mentioned in Beharul Anwar that Imam Baqir (as) said: “The Qaem (as) shall rule for 309 years – equal to the number of years the people of the cave (Ashabe Kahf) slept in their cave – he would fill up the earth with justice and equity just as it would be fraught with injustice and oppression. Then the Almighty Allah would conquer the whole earth for him. He would eliminate people till there remains nothing but the religion of Mohammed (sawa). He would act like Sulayman bin Dawood and he would call out to the sun and the moon and they shall reply to him. And the earth would be illuminated for him. He would receive divine revelation and he would act according to the command of Allah.” (Beharul Anwar volume 52 page 390)
(The above article was taken and adapted from the book Mikyalul Makarim Fee Fawaedid Dua Lil Qaem)