### Question:
ArchiveResolver implements Resolver { @Override public String resolve() { String location = null; try { location = installer.install(archive); } catch(InstallationException e) { LOGGER.error("Unable to resolve phantomjs binary",e); } return location; } ArchiveResolver(Installer installer, Archive archive); @Override String resolve();  }### Answer:
@Test public void shouldLocate() throws Exception { when(installer.install(archive)).thenReturn(LOCATION); assertThat(locator.resolve()).isEqualTo(LOCATION); }
@Test public void testLocateShouldHandleException() throws Exception { when(installer.install(archive)).thenThrow(new InstallationException("error", new RuntimeException())); assertThat(locator.resolve()).isNull(); }