Search in sources :

Example 1 with Update

use of org.springframework.boot.buildpack.platform.docker.type.ContainerConfig.Update in project spring-boot by spring-projects.

the class PhaseTests method applyWhenWithEnvUpdatesConfigurationWithEnv.

@Test
void applyWhenWithEnvUpdatesConfigurationWithEnv() {
    Phase phase = new Phase("test", false);
    phase.withEnv("name1", "value1");
    phase.withEnv("name2", "value2");
    Update update = mock(Update.class);
    phase.apply(update);
    then(update).should().withCommand("/cnb/lifecycle/test");
    then(update).should().withLabel("author", "spring-boot");
    then(update).should().withEnv("name1", "value1");
    then(update).should().withEnv("name2", "value2");
    then(update).shouldHaveNoMoreInteractions();
}
Also used : Update(org.springframework.boot.buildpack.platform.docker.type.ContainerConfig.Update) Test(org.junit.jupiter.api.Test)

Example 2 with Update

use of org.springframework.boot.buildpack.platform.docker.type.ContainerConfig.Update in project spring-boot by spring-projects.

the class PhaseTests method applyWhenWithBindsUpdatesConfigurationWithBinds.

@Test
void applyWhenWithBindsUpdatesConfigurationWithBinds() {
    Phase phase = new Phase("test", false);
    VolumeName volumeName = VolumeName.of("test");
    phase.withBinding(Binding.from(volumeName, "/test"));
    Update update = mock(Update.class);
    phase.apply(update);
    then(update).should().withCommand("/cnb/lifecycle/test");
    then(update).should().withLabel("author", "spring-boot");
    then(update).should().withBinding(Binding.from(volumeName, "/test"));
    then(update).shouldHaveNoMoreInteractions();
}
Also used : VolumeName(org.springframework.boot.buildpack.platform.docker.type.VolumeName) Update(org.springframework.boot.buildpack.platform.docker.type.ContainerConfig.Update) Test(org.junit.jupiter.api.Test)

Example 3 with Update

use of org.springframework.boot.buildpack.platform.docker.type.ContainerConfig.Update in project spring-boot by spring-projects.

the class PhaseTests method applyWhenWithNetworkModeUpdatesConfigurationWithNetworkMode.

@Test
void applyWhenWithNetworkModeUpdatesConfigurationWithNetworkMode() {
    Phase phase = new Phase("test", true);
    phase.withNetworkMode("test");
    Update update = mock(Update.class);
    phase.apply(update);
    then(update).should().withCommand("/cnb/lifecycle/test");
    then(update).should().withNetworkMode("test");
    then(update).should().withLabel("author", "spring-boot");
    then(update).shouldHaveNoMoreInteractions();
}
Also used : Update(org.springframework.boot.buildpack.platform.docker.type.ContainerConfig.Update) Test(org.junit.jupiter.api.Test)

Example 4 with Update

use of org.springframework.boot.buildpack.platform.docker.type.ContainerConfig.Update in project spring-boot by spring-projects.

the class PhaseTests method applyWhenWithLogLevelArgAndNonVerboseLoggingDoesNotUpdateLogLevel.

@Test
void applyWhenWithLogLevelArgAndNonVerboseLoggingDoesNotUpdateLogLevel() {
    Phase phase = new Phase("test", false);
    phase.withLogLevelArg();
    Update update = mock(Update.class);
    phase.apply(update);
    then(update).should().withCommand("/cnb/lifecycle/test");
    then(update).should().withLabel("author", "spring-boot");
    then(update).shouldHaveNoMoreInteractions();
}
Also used : Update(org.springframework.boot.buildpack.platform.docker.type.ContainerConfig.Update) Test(org.junit.jupiter.api.Test)

Example 5 with Update

use of org.springframework.boot.buildpack.platform.docker.type.ContainerConfig.Update in project spring-boot by spring-projects.

the class PhaseTests method applyWhenWithLogLevelArgAndVerboseLoggingUpdatesConfigurationWithLogLevel.

@Test
void applyWhenWithLogLevelArgAndVerboseLoggingUpdatesConfigurationWithLogLevel() {
    Phase phase = new Phase("test", true);
    phase.withLogLevelArg();
    Update update = mock(Update.class);
    phase.apply(update);
    then(update).should().withCommand("/cnb/lifecycle/test", "-log-level", "debug");
    then(update).should().withLabel("author", "spring-boot");
    then(update).shouldHaveNoMoreInteractions();
}
Also used : Update(org.springframework.boot.buildpack.platform.docker.type.ContainerConfig.Update) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)8 Update (org.springframework.boot.buildpack.platform.docker.type.ContainerConfig.Update)8 VolumeName (org.springframework.boot.buildpack.platform.docker.type.VolumeName)1