The name "Josaphat," as it turns out, is derived from Arabic Yūdhasaf or Būdhasaf, which is derived from the title Buddha (enlightened one) and refers to Siddhartha Gautama (c. 563-483 B.C.). The story is essentially a retelling of the life story of the Buddha.
The story was popular and eventually Josaphat managed to get assigned a day in the calendar not only in the Roman church, but also in the Greek and Slavic churches.
You have to wonder if the Serpent was laughing at professing Christians unwittingly asking Buddha to "ora pro nobis." While the fact that Josaphat = Buddha was not discovered until the 19th century, the Reformers warned against the veneration of saints, not only on the general grounds that such veneration is wrong, but also on the specific ground that many of the saints were not true believers.
Thomas Newton, in the 18th century, expressed it this way (source):
It is impossible to relate or enumerate all the various falsehoods and lies which have been invented and propagated for this purpose; the fabulous books forged under the names of apostles, saints, and martyrs; the fabulous legends of their lives, actions, sufferings, and deaths; the fabulous miracles ascribed to their sepulchres, bones, and other relics; the fabulous dreams and revelations, visions and apparitions of the dead to the living and even the fabulous saints who never existed but in the imagination of their worshippers. And all these stories the monks the priests the bishops of the church have imposed and obtruded upon mankind it is difficult to say whether with greater artifice or cruelty with greater confidence or hypocrisy and pretended sanctity, a more hardened face or a more hardened conscience.-TurretinFan