And he said to Jehoshaphat, “Will you go with me to battle at Ramoth-gilead?” And Jehoshaphat said to the king of Israel, “I am as you are, my people as your people, my horses as your horses.” And Jehoshaphat said to the king of Israel, “Inquire first for the word of YHWH.”
1 Kings 22:4-5

Jehoshaphat was a righteous king in most respects, but he was naive and impulsive when it came to dealing with the kings of Israel. When Ahab asked him to ally with him in war against Syria he agreed first and only then thought to ask for God's input. This impetuousness would get him and the people of Judah into trouble on multiple occasions.