A declaration of faith by a Believer is a proclamation of being an Aashiq (a lover of Allah subhaanahu wataala) and it is the dastoor (the way) of this world that the beloved will test the lover. Allah subhaanahu wataala knows the state of our hearts so He tests the Believers to differentiate the liars and the truthful ones. Without these tests the liars and the hypocrites will claim injustice on the Day of Judgement when theyre consigned to the Fire.
Those who fail these tests will wail and moan and ask Why me? On the other hand the true lovers will say But this is what Allah subhaanahu wataal and His Rasool sallallaahu alayhi wasallam promised. We expected to be tested. We are yours O our Lord, They will accept without question the decree of the Beloved with an increase in their love and strengthening of their faith.
They will remain firm despite the trials and tribulations coming their way, like the tender crop swaying in the direction of the blowing winds. If the winds come from one direction they will bend one way and then stand up straight only to be bent in another direction with the blowing winds. A tall standing tree on the other hand will not be affected by the winds. It will remain standing straight, seemingly indestructible until a gale force wind comes along and removes it from its root and it is thrown aside, useless and destroyed.

"The example of a believer is that of a fresh tender plant, which the wind bends it sometimes and some other time it makes it straight.
And the example of a hypocrite is that of a pine tree which keeps straight till once it is uprooted suddenly.
Chapter of Patients, Bukhari Shareef
Volume 7, Book 70, Number 546:
Therefore when struck by pain and grief, loss of wealth or loved ones, remain steadfast and ask for ease and aafiyat (safety) and know that you are among the Believers, the true lovers of Allah subhaanahu wataala.
(A lover does not question/doubt the beloved)