The Lord was with Jehoshaphat because in his young life he did the good things his ancestor David did. Jehoshaphat did not follow the Baal idols.