Despite Joseph's outstanding character, it seems the worst continues to befall him. How can horrible things happening to a good man possibly be God's plan? Is this story even about Joseph at all?

Despite Joseph's outstanding character, it seems the worst continues to befall him. How can horrible things happening to a good man possibly be God's plan? Is this story even about Joseph at all?