And indeed, We destroyed generations before you when they did wrong, while their Messengers came to them with clear proofs, but they were not such as to believe! Thus do We requite the people who are criminals.
Then We made you successors after them, generations after generations in the land, that We might see how you would work.
Allah tells us about what happened to past generations when they belied the Messengers and the clear signs and proofs the latter brought to them. Allah then made this nation successor after them. He sent to them a Messenger to test their obedience to Him and following His Messenger.
Muslim recorded that Abu Nadrah reported from Abu Sa`id that he said;
"Allah's Messenger said;
إِنَّ الدُّنْيَا حُلْوَةٌ خَضِرَةٌ وَإِنَّ اللهَ مُسْتَخْلِفُكُمْ فِيهَا فَنَاظِرٌ كَيْفَ تَعْمَلُونَ فَاتَّقُوا الدُّنْيَا وَاتَّقُوا النِّسَاءَ فَإِنَّ أَوَّلَ فِتْنَةِ بِنَي إِسْرَايِيلَ كَانَتْ فِي النِّسَاء
The world is indeed sweet and green; and verily Allah is going to install you generations after generations in it in order to see how you act. So safeguard yourselves against the world and avoid (the trial caused by) women. For the first trial of the Children of Israel was due to women."
Ibn Jarir reported from Abdur-Rahman from Ibn Abi Layla that;
Awf bin Malik said to Abu Bakr;"In a dream, I saw a rope hanging from the sky and Allah's Messenger was being raised. The rope was suspended again and Abu Bakr was raised. Then people were given different measurements around the Minbar, and Umar was favored with three forearm measurements."
Umar said;"Keep your dream away from us, we have no need for it."
When Umar succeeded, he called for Awf and said to him, "Tell me about your dream"
Awf said;"Do you need to hear about my dream now! Did you not scold me before!"
He then said, "Woe unto you! I hated for you to announce it to the successor of Allah's Messenger himself."
So Awf related his dream until he got to the three forearms, he said;"One that he was Khalifah, second he did not -- for the sake of Allah -- fear the blame of blamers, and third he was a martyr."
Allah said;
ثُمَّ جَعَلْنَاكُمْ خَلَيِفَ فِي الَارْضِ مِن بَعْدِهِم لِنَنظُرَ كَيْفَ تَعْمَلُونَ
Then We made you successors after them, generations after generations in the land, that We might see how you would work.
Then he said;"Son of the mother of Umar, you have been appointed as Khalifah, so look at what you will do! About not fearing the blame of blamers, that is Allah's will.
About becoming a martyr, how can Umar reach that when the Muslims are in support of him!