PathImporter { public ImportReport forceImportFromPath(Path extractDir, final ArtifactImporter importer) { return importFromPath(extractDir, importer, new Function<Import, ImportReport>() { @Override public ImportReport apply(Import anImport) { return importer.forceImport(anImport); } }); } @Inject  PathImporter(ImportStore importStore); ImportReport importFromPath(Path extractDir, final ArtifactImporter importer); ImportReport forceImportFromPath(Path extractDir, final ArtifactImporter importer);  }
@Test public void should_force_import_of_zip_file() throws Exception { Import anImport = aMockedImport(); ImportReport expectedReport = anImportReportFor(aPage()).withStatus(IMPORTED).build(); when(importer.forceImport(anImport)).thenReturn(expectedReport); ImportReport report = pathImporter.forceImportFromPath(unzipedPath, importer); assertThat(expectedReport).isEqualTo(report); verify(importStore).remove(anImport.getUUID()); }