2 Not that He first knows the things of a man on his being proved (for He knows them all before they come to pass), but because He is good and philanthropic, He distributes to each a due reward according to his actions, so that every man may exclaim, Righteous is the judgment of God! As the prophet says again, 'The Lord tries the just, and discerns the reins. ' Again, for this cause He tries each one of us, either that to those who know it not, virtue may be manifested by means of those who are proved, as was said respecting Job; 'Do you think that I was revealed to you for any other cause, than that you should be seen righteous?' or that, when men come to a sense of their deeds, they may be able to know of what manner they are, and so may either repent of their wickedness, or abide confirmed in the faith. Now the blessed Paul, when troubled by afflictions, and persecutions, and hunger and thirst, 'in everything was a conqueror, through Jesus Christ, Who loved us.' Through suffering he was weak indeed in body, yet, believing and hoping, he was made strong in spirit, and his strength was made perfect in weakness.
Source: Letters (New Advent)