Source:
<code>public void testNoZipFileDumpedWhenTransformFails() throws Exception { MetacardTransformer transformer = mock(MetacardTransformer.class); when(transformer.transform(any(), any())).thenThrow(CatalogTransformerException.class); QueryResponseTransformer zipCompressionMock = mock(QueryResponseTransformer.class); when(zipCompressionMock.transform(any(), any())).thenThrow(CatalogTransformerException.class); List<MetacardTransformer> transformers = new ArrayList<>(); transformers.add(transformer); List<Result> resultList = getResultList("id1", "id2"); MetacardImpl metacard1 = new MetacardImpl(resultList.get(0).getMetacard()); MetacardImpl metacard2 = new MetacardImpl(resultList.get(1).getMetacard()); metacard1.setResourceURI(new URI("content:" + metacard1.getId())); metacard2.setResourceURI(new URI("content:" + metacard2.getId() + "#preview")); TestDumpCommand dumpCommand = new TestDumpCommand(transformers, zipCompressionMock); dumpCommand.catalogFramework = givenCatalogFramework(resultList); dumpCommand.filterBuilder = new GeotoolsFilterBuilder(); File outputDirectory = testFolder.newFolder("somedirectory"); String outputDirectoryPath = outputDirectory.getAbsolutePath(); dumpCommand.dirPath = outputDirectoryPath; dumpCommand.transformerId = "someOtherTransformer"; <START> Path zipfilePath = Paths.get(outputDirectoryPath.toString(), "foo.zip"); <END> dumpCommand.zipFileName = zipfilePath.toString(); dumpCommand.executeWithSubject(); assertThat(consoleOutput.getOutput(), containsString(" 0 file(s) dumped in ")); assertThat(zipfilePath.toFile().exists(), is(false)); }</code><technical_language>outputDirectoryPath is a String</technical_language>

Target:
public void testNoZipFileDumpedWhenTransformFails() throws Exception { MetacardTransformer transformer = mock(MetacardTransformer.class); when(transformer.transform(any(), any())).thenThrow(CatalogTransformerException.class); QueryResponseTransformer zipCompressionMock = mock(QueryResponseTransformer.class); when(zipCompressionMock.transform(any(), any())).thenThrow(CatalogTransformerException.class); List<MetacardTransformer> transformers = new ArrayList<>(); transformers.add(transformer); List<Result> resultList = getResultList("id1", "id2"); MetacardImpl metacard1 = new MetacardImpl(resultList.get(0).getMetacard()); MetacardImpl metacard2 = new MetacardImpl(resultList.get(1).getMetacard()); metacard1.setResourceURI(new URI("content:" + metacard1.getId())); metacard2.setResourceURI(new URI("content:" + metacard2.getId() + "#preview")); TestDumpCommand dumpCommand = new TestDumpCommand(transformers, zipCompressionMock); dumpCommand.catalogFramework = givenCatalogFramework(resultList); dumpCommand.filterBuilder = new GeotoolsFilterBuilder(); File outputDirectory = testFolder.newFolder("somedirectory"); String outputDirectoryPath = outputDirectory.getAbsolutePath(); dumpCommand.dirPath = outputDirectoryPath; dumpCommand.transformerId = "someOtherTransformer"; Path zipfilePath = Paths.get(outputDirectoryPath, "foo.zip"); dumpCommand.zipFileName = zipfilePath.toString(); dumpCommand.executeWithSubject(); assertThat(consoleOutput.getOutput(), containsString(" 0 file(s) dumped in ")); assertThat(zipfilePath.toFile().exists(), is(false)); }