@Test(expected = RuntimeException.class) public void givenPathToResourceThatDoesNotExist_whenGetResourceContentIsCalled_thenExceptionIsThrown() { getResourceContent("path/to/resource"); }
public static String getResourceContent(String location) { try (InputStream input = getResourceInputStream(location)) { return IOUtils.toString(input, StandardCharsets.UTF_8); } catch (Exception e) { throw new RuntimeException(e); } }
ClassPathResourceProvider { public static String getResourceContent(String location) { try (InputStream input = getResourceInputStream(location)) { return IOUtils.toString(input, StandardCharsets.UTF_8); } catch (Exception e) { throw new RuntimeException(e); } } }
ClassPathResourceProvider { public static String getResourceContent(String location) { try (InputStream input = getResourceInputStream(location)) { return IOUtils.toString(input, StandardCharsets.UTF_8); } catch (Exception e) { throw new RuntimeException(e); } }  }
ClassPathResourceProvider { public static String getResourceContent(String location) { try (InputStream input = getResourceInputStream(location)) { return IOUtils.toString(input, StandardCharsets.UTF_8); } catch (Exception e) { throw new RuntimeException(e); } }  static String getResourcePath(String location); static String getResourceContent(String location); static List<String> getResourcesContents(String... locations); static InputStream getResourceInputStream(String location); static InputStreamReader getResourceReader(String location); }
ClassPathResourceProvider { public static String getResourceContent(String location) { try (InputStream input = getResourceInputStream(location)) { return IOUtils.toString(input, StandardCharsets.UTF_8); } catch (Exception e) { throw new RuntimeException(e); } }  static String getResourcePath(String location); static String getResourceContent(String location); static List<String> getResourcesContents(String... locations); static InputStream getResourceInputStream(String location); static InputStreamReader getResourceReader(String location);  }