Sandro Rey :
Jonas Berlin :
Using mostly the same methods you used:
new String(Files.readAllBytes(Paths.get(CustomerControllerIT.class.getResource("CustomerOrganization.json").toURI())));
However, if you need it to work from inside a JAR, you will need to do this instead:
InputStream inputStream = CustomerControllerIT.class.getResourceAsStream("CustomerOrganization.json");
// TODO pick one of the solutions from below url
// to read the inputStream into a string:
// https://stackoverflow.com/a/35446009/1356047
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=327701&siteId=1