22 April 2021

To read a file from java test resource into a string you can just use this one-liner. It uses java.nio package - no need to handle InputStreams.

String xml = Files.readString(Paths.get("src/test/resources/xml/SimpleXmlForm.xml"));