Search in sources :

Example 1 with VolumeName

use of org.springframework.boot.buildpack.platform.docker.type.VolumeName 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 2 with VolumeName

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

the class LifecycleTests method executeWhenCleanCacheClearsCache.

@Test
void executeWhenCleanCacheClearsCache() throws Exception {
    given(this.docker.container().create(any())).willAnswer(answerWithGeneratedContainerId());
    given(this.docker.container().create(any(), any())).willAnswer(answerWithGeneratedContainerId());
    given(this.docker.container().wait(any())).willReturn(ContainerStatus.of(0, null));
    BuildRequest request = getTestRequest().withCleanCache(true);
    createLifecycle(request).execute();
    assertPhaseWasRun("creator", withExpectedConfig("lifecycle-creator-clean-cache.json"));
    VolumeName name = VolumeName.of("pack-cache-b35197ac41ea.build");
    then(this.docker.volume()).should().delete(name, true);
}
Also used : VolumeName(org.springframework.boot.buildpack.platform.docker.type.VolumeName) Test(org.junit.jupiter.api.Test)

Aggregations

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