Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) says: I was with the Prophet (peace and blessings be upon him) on the Night of the Delegation of the Jinn, and he (peace and blessings be upon him) heaved a breath. I said: "O Messenger of Allah! What is the matter with you (peace and blessings be upon him)?" He said: "O Ibn Mas'ud! I have been informed of my death." I said: "Appoint someone as successor." He said: "Whom?" I said: "Abu Bakr." The narrator says: He (peace and blessings be upon him) fell silent. Then some time passed, then he heaved a breath again. I said: "May my father and mother be sacrificed for you, O Messenger of Allah! What is the matter with you (peace and blessings be upon him)?" He said: "O Ibn Mas'ud! I have been informed of my death." I said: "Then appoint someone as successor." He said: "Whom?" I said: "Umar." He (peace and blessings be upon him) fell silent. Then some time passed, then he heaved a breath again. I said: "What is the matter with you (peace and blessings be upon him)?" He said: "O Ibn Mas'ud! I have been informed of my death." I said: "Then appoint someone as successor." He said: "Whom?" I said: "Ali bin Abi Talib." He said: "Listen! By the One in whose hand my soul is, if they obey him, they will all, every one of them, enter Paradise."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 9934