ResourceLoader { public URL getResource(final String path) { Validate.notEmpty(path, "Path can not be empty"); return getClass().getResource(path); }  URL getResource(final String path);  }
@Test public void getResourceShouldThrowExceptionIfPathIsNull() { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("Path can not be empty"); resourceLoader.getResource(null); }
@Test public void getResourceShouldThrowExceptionIfPathIsBlank() { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("Path can not be empty"); resourceLoader.getResource(" "); }
@Test public void getResourceShouldReturnValidUrlIfFileExists() { assertNotNull(resourceLoader.getResource("/test-messages.properties")); }
@Test public void getResourceShouldReturnNullIfFileDoesNotExist() { assertNull(resourceLoader.getResource("/sounds/unknown.wav")); }