サンドロ・レイ:
ジョナスベルリン:
あなたが使用され、ほとんど同じメソッドを使用します:
new String(Files.readAllBytes(Paths.get(CustomerControllerIT.class.getResource("CustomerOrganization.json").toURI())));
あなたがJAR内から仕事にそれを必要とする場合は、あなたの代わりにこれを実行する必要があります。
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