Imam Ali al-Hadi (a) is reported to have said, 
"Allah has made this world a testing place while the Hereafter is the result of our test. He has also made the misfortunes of this world the means 
of gaining rewards in the Hereafter and made the 
rewards of the Hereafter the compensation for the misfortunes of this world".  (Tuhaf al-Uqool Maxim #11)