How is this a question that tests integrity?
It is a test to see if he understands what he claims to.
I don't know why He was portrayed as angry.
He was angry to demonstrate our imperfections. Paul said that these things happened for our instruction (paraphrase).
This demonstration was used to further demonstrate the great work of mercy that He would have on us.
The old testament was performed (including God's anger) to demonstrate the effect of the law, which was used to show us that we are flawed (rebellious).
Once we realize that we have a problem, God provides the perfect Solution.
Perhaps His actions were interpreted as the actions of an angry being?
No, I believe He means exactly what He says. He was, indeed, angry. He allowed Himself to experience these emotions for our benefit.
Just like the misinterpretation that death is evil.
The Bible portrays spiritual death as something to be avoided, but physical death as something to experience in purity and honor.
Since God knows everything both past and future, how can He be angry at the actions of mere humans for doing what He knew they were going to do? Wouldn't that make Him angry all the time since He knows off all our disobediences already?
No.
God's anger towards us is for our correction. It is an instrument of communication that we are capable of understanding in our rebellious immaturity.
Just as if you had a child who did something harmful (rebellious) to himself/herself after you told them not to, you would allow yourself to experience anger so the child would fear and stop doing it because you don't want them to harm themselves.
When the child becomes mature and is no longer rebellious (hopefully), there is no need for anger. When they are mature, their motivation (to do harm that was buffered by fear invoked by your anger) turns to love, at which point there is no longer a need for anger and your parent/child relationship becomes a friend/friend relationship.
(...fear of God is the BEGINNING of acting wise...)
(...and Moses was called the friend of God...)
Simply put, the anger is a form of communication necessary because of our immaturity and rebellion.
Enter modern times when people take no time to understand this concept.
Then, humans, because of various lies (to discredit the Bible) and seductions that induce fears (lack of faith), fall into the trap of being led by their emotions all the time. Then they assume that God lives with the same limits, then they become incapable of understanding the true nature of God.
However, if we became mature, we would experience all of the wonderful emotions that our mature actions bring.
In short, when you truly learn to love God, your life's turmoil turns into peace, even in troubled times.
If we are rebellious children, God speaks to us as rebellious children.
When we are mature, God speaks to us as a friend.