When the king of Judah arrives home after he teamed up with the king of Israel to go against he Arameans, a battle which they lost, he is confronted with his own prophet. Jehu comes out and and scolds him for teaming up with Ahab. Why would you team up with the wicked even if you think you are doing a good thing? God is very angry with you, but since you are a good person and have done good things, then you will be okay.
In fact we see the king of Judah settles in and appoints judges and they do a good job. He then also set up priests who would give judgment for those cases which were disputed. He tells all the people who were working for the Lord the following: “Deal courageously, and may the Lord be with the good!” That is a bit of an unusual encouragement. Do good and you will prosper. Sounds more like Star Trek than it does the Bible.