ZipInstallationStarter implements InstallationStarter { @Override public Installation start(File targetFolder, ProgressReport report) { Installation start = wrapped.start(targetFolder, report); return new ZipInstallation(start, report); } ZipInstallationStarter(InstallationStarter wrapped); @Override Installation start(File targetFolder, ProgressReport report);  }
@Test public void startsInstallationWithWrappedStarter() throws Exception { Installation wrappedInstallation = mock(Installation.class); when(wrapped.start(folder.getRoot(), report)).thenReturn(wrappedInstallation); Installation installation = starter.start(folder.getRoot(), report); installation.finish(); verify(wrappedInstallation).finish(); }
@Test public void returnsZipInstallation() throws Exception { Installation installation = starter.start(folder.getRoot(), report); assertThat(installation, CoreMatchers.is(instanceOf(ZipInstallation.class))); }