Yahweh was with Jehoshaphat because he walked in the first ways of his father David, and did not seek the Baals.