use of io.fabric8.maven.docker.service.helper.StartContainerExecutor in project docker-maven-plugin by fabric8io.
the class StartContainerExecutorTest method getExposedPropertyKeyPart_withRunConfig.
@Test
public void getExposedPropertyKeyPart_withRunConfig() {
// Given
final RunImageConfiguration runConfig = new RunImageConfiguration.Builder().exposedPropertyKey("key").build();
final ImageConfiguration imageConfig = new ImageConfiguration.Builder().name("name").alias("alias").runConfig(runConfig).build();
final StartContainerExecutor executor = new StartContainerExecutor.Builder().imageConfig(imageConfig).build();
// When
final String actual = executor.getExposedPropertyKeyPart();
// Then
assertEquals("key", actual);
}
use of io.fabric8.maven.docker.service.helper.StartContainerExecutor in project docker-maven-plugin by fabric8io.
the class StartContainerExecutorTest method showLogs_withLogConfigEnabled.
@Test
public void showLogs_withLogConfigEnabled() {
// Given
final LogConfiguration logConfig = new LogConfiguration.Builder().enabled(true).build();
final RunImageConfiguration runConfig = new RunImageConfiguration.Builder().exposedPropertyKey("key").log(logConfig).build();
final ImageConfiguration imageConfig = new ImageConfiguration.Builder().name("name").alias("alias").runConfig(runConfig).build();
final StartContainerExecutor executor = new StartContainerExecutor.Builder().imageConfig(imageConfig).build();
// When
final boolean actual = executor.showLogs();
// Then
assertTrue(actual);
}
use of io.fabric8.maven.docker.service.helper.StartContainerExecutor in project docker-maven-plugin by fabric8io.
the class StartContainerExecutorTest method showLogs_withoutLogConfigButFollowTrue.
@Test
public void showLogs_withoutLogConfigButFollowTrue() {
// Given
final RunImageConfiguration runConfig = new RunImageConfiguration.Builder().exposedPropertyKey("key").build();
final ImageConfiguration imageConfig = new ImageConfiguration.Builder().name("name").alias("alias").runConfig(runConfig).build();
final StartContainerExecutor executor = new StartContainerExecutor.Builder().imageConfig(imageConfig).follow(true).build();
// When
final boolean actual = executor.showLogs();
// Then
assertTrue(actual);
}
use of io.fabric8.maven.docker.service.helper.StartContainerExecutor in project docker-maven-plugin by fabric8io.
the class StartContainerExecutorTest method showLogs_withShowLogsMatchRandomImage.
@Test
public void showLogs_withShowLogsMatchRandomImage() {
// Given
final ImageConfiguration imageConfig = new ImageConfiguration.Builder().name("name").alias("alias").build();
final StartContainerExecutor executor = new StartContainerExecutor.Builder().showLogs("some_random_string").imageConfig(imageConfig).build();
// When
final boolean actual = executor.showLogs();
// Then
assertFalse(actual);
}
use of io.fabric8.maven.docker.service.helper.StartContainerExecutor in project docker-maven-plugin by fabric8io.
the class StartContainerExecutorTest method showLogs_withLogConfigDisabled.
@Test
public void showLogs_withLogConfigDisabled() {
// Given
final LogConfiguration logConfig = new LogConfiguration.Builder().enabled(false).build();
final RunImageConfiguration runConfig = new RunImageConfiguration.Builder().exposedPropertyKey("key").log(logConfig).build();
final ImageConfiguration imageConfig = new ImageConfiguration.Builder().name("name").alias("alias").runConfig(runConfig).build();
final StartContainerExecutor executor = new StartContainerExecutor.Builder().imageConfig(imageConfig).build();
// When
final boolean actual = executor.showLogs();
// Then
assertFalse(actual);
}
Aggregations