Relationship will have tests. Relationship with mum, with dad, with siblings and with friends as well. Sometimes it just break you so deeply. Sometimes you felt like 'how could he/she do this to me?'
Knew that, everything happen to you, Allah lets it happen. Allah can make it not happen to you, but He made it happen. He lets that person hurt you.
But it doesnt mean He hates or wants to punish you. His Merciful and Love is so great that its overwhelmed His anger and wrath.
And as long as you were feeling pain in this duniya and not in the akhirah, hence its a blessing; its not a punishment. He knew His creation too well. If He lets His creation in happiness for so long in this duniya, His creation will be distracted by this duniya games and eventually turns away from Him. Loving the duniya instead of the Creator of the duniya.
So He knew you so well. And thats why He gives you the feeling of pain and hurt. Because you will always search 'home' when you are hurt. And the only 'home' for your heart is Allah.
So if you understand His plans correctly, the only pain that you felt is the door that lead you to Allah. And even if you are in pain, always remember that our Lord is infinitely Kind. Be thankful and be sabr. One day when you are in awesome Jannah (amiin) , you will forget all the storms you faced in duniya. You will feel so alhamdulillah and so close to Allah in Jannah. And how beautiful is His promises:')