Satan, I believe, thought Job would trip over that same question. He tried to make the case that people who trust God's goodness have only a fair-weather faith. But Job showed the strength of God's hold on his heart. Although Job did struggle for answers, he came to a sense of acceptance as he recognized God's greatness and wisdom. He reaffirmed his confidence in God to do what was best.
Afflictions become blessings when blended with acceptance.