@Test public void testGetResourceStreamNotFound() throws Exception { final String source = "i will never ever exist!"; ResourceNotFoundException e = assertThrows(ResourceNotFoundException.class, () -> { loader.getResourceStream(source); }); assertThat(e.getMessage()).isEqualTo("Resource not found: " + source); }
@Override public InputStream getResourceStream(final String source) throws ResourceNotFoundException { final InputStream stream = ClassResourceLoader.class.getResourceAsStream(source); if (stream == null) { throw new ResourceNotFoundException("Resource not found: " + source); } return stream; }
ClassResourceLoader extends ResourceLoader { @Override public InputStream getResourceStream(final String source) throws ResourceNotFoundException { final InputStream stream = ClassResourceLoader.class.getResourceAsStream(source); if (stream == null) { throw new ResourceNotFoundException("Resource not found: " + source); } return stream; } }
ClassResourceLoader extends ResourceLoader { @Override public InputStream getResourceStream(final String source) throws ResourceNotFoundException { final InputStream stream = ClassResourceLoader.class.getResourceAsStream(source); if (stream == null) { throw new ResourceNotFoundException("Resource not found: " + source); } return stream; }  }
ClassResourceLoader extends ResourceLoader { @Override public InputStream getResourceStream(final String source) throws ResourceNotFoundException { final InputStream stream = ClassResourceLoader.class.getResourceAsStream(source); if (stream == null) { throw new ResourceNotFoundException("Resource not found: " + source); } return stream; }  @Override void init(final ExtendedProperties configuration); @Override InputStream getResourceStream(final String source); @Override boolean isSourceModified(final Resource resource); @Override long getLastModified(final Resource resource); }
ClassResourceLoader extends ResourceLoader { @Override public InputStream getResourceStream(final String source) throws ResourceNotFoundException { final InputStream stream = ClassResourceLoader.class.getResourceAsStream(source); if (stream == null) { throw new ResourceNotFoundException("Resource not found: " + source); } return stream; }  @Override void init(final ExtendedProperties configuration); @Override InputStream getResourceStream(final String source); @Override boolean isSourceModified(final Resource resource); @Override long getLastModified(final Resource resource);  }