use of com.google.cloud.tools.jib.cli.ArtifactProcessor in project jib by google.
the class ArtifactProcessorsTest method testFromWar_noJettyBaseImageAndAppRootPresent_success.
@Test
public void testFromWar_noJettyBaseImageAndAppRootPresent_success() throws InvalidImageReferenceException {
when(mockWarCommand.getAppRoot()).thenReturn(Optional.of(AbsoluteUnixPath.get("/app-root")));
when(mockCacheDirectories.getExplodedArtifactDirectory()).thenReturn(Paths.get("exploded-artifact"));
ArtifactProcessor processor = ArtifactProcessors.fromWar(Paths.get("my-app.war"), mockCacheDirectories, mockWarCommand, mockCommonContainerConfigCliOptions);
assertThat(processor).isInstanceOf(StandardWarExplodedProcessor.class);
}
use of com.google.cloud.tools.jib.cli.ArtifactProcessor in project jib by GoogleContainerTools.
the class ArtifactProcessorsTest method testFromJar_springBootExploded.
@Test
public void testFromJar_springBootExploded() throws IOException, URISyntaxException {
Path jarPath = Paths.get(Resources.getResource(SPRING_BOOT).toURI());
Path explodedJarRoot = temporaryFolder.getRoot().toPath();
when(mockCacheDirectories.getExplodedArtifactDirectory()).thenReturn(explodedJarRoot);
when(mockJarCommand.getMode()).thenReturn(ProcessingMode.exploded);
ArtifactProcessor processor = ArtifactProcessors.fromJar(jarPath, mockCacheDirectories, mockJarCommand, mockCommonContainerConfigCliOptions);
verify(mockCacheDirectories).getExplodedArtifactDirectory();
assertThat(processor).isInstanceOf(SpringBootExplodedProcessor.class);
}
use of com.google.cloud.tools.jib.cli.ArtifactProcessor in project jib by GoogleContainerTools.
the class ArtifactProcessorsTest method testFromWar_jettyBaseImageSpecified_success.
@Test
public void testFromWar_jettyBaseImageSpecified_success() throws InvalidImageReferenceException {
when(mockCommonContainerConfigCliOptions.isJettyBaseimage()).thenReturn(true);
ArtifactProcessor processor = ArtifactProcessors.fromWar(Paths.get("my-app.war"), mockCacheDirectories, mockWarCommand, mockCommonContainerConfigCliOptions);
assertThat(processor).isInstanceOf(StandardWarExplodedProcessor.class);
}
use of com.google.cloud.tools.jib.cli.ArtifactProcessor in project jib by GoogleContainerTools.
the class ArtifactProcessorsTest method testFromJar_standardPackaged.
@Test
public void testFromJar_standardPackaged() throws IOException, URISyntaxException {
Path jarPath = Paths.get(Resources.getResource(STANDARD).toURI());
when(mockJarCommand.getMode()).thenReturn(ProcessingMode.packaged);
ArtifactProcessor processor = ArtifactProcessors.fromJar(jarPath, mockCacheDirectories, mockJarCommand, mockCommonContainerConfigCliOptions);
verifyNoInteractions(mockCacheDirectories);
assertThat(processor).isInstanceOf(StandardPackagedProcessor.class);
}
Aggregations