### Question:
PipeResourceLocator { public URL getImage(String image) { return getResource(IMAGE_PATH,image,".png"); }  URL getImage(String image); URL getExample(String example); URL getExamplePath(); URL getImagePath();  }### Answer:
@Test public void verifyGetsImage() { PipeResourceLocator locator = new PipeResourceLocator(); URL url = locator.getImage("About"); assertTrue(url.getPath().endsWith("/images/About.png")); url = locator.getImage("Add token"); assertTrue("embedded blanks ok",url.getPath().endsWith("/images/Add%20token.png")); }
@Test public void verifyImageNotFoundTellsWhereWeLooked() { expectedException.expect(RuntimeException.class); expectedException.expectMessage("Could not find nonexistent.png in "); PipeResourceLocator locator = new PipeResourceLocator(); locator.getImage("nonexistent"); }