use of org.eclipse.jkube.kit.config.image.build.BuildConfiguration in project jkube by eclipse.
the class AssemblyManagerTest method testCopyValidVerifyGivenDockerfile.
@Test
public void testCopyValidVerifyGivenDockerfile(@Injectable final KitLogger logger) throws IOException {
BuildConfiguration buildConfig = createBuildConfig();
AssemblyManager.verifyAssemblyReferencedInDockerfile(new File(getClass().getResource("/docker/Dockerfile_assembly_verify_copy_valid.test").getPath()), buildConfig, new Properties(), logger);
// @formatter:off
new Verifications() {
{
logger.warn(anyString, (Object[]) any);
times = 0;
}
};
// @formatter:on
}
use of org.eclipse.jkube.kit.config.image.build.BuildConfiguration in project jkube by eclipse.
the class BuildUtilTest method extractBaseFromConfiguration_withEmptyBuildConfiguration_shouldReturnData.
@Test
public void extractBaseFromConfiguration_withEmptyBuildConfiguration_shouldReturnData() {
// When
final String result = extractBaseFromConfiguration(new BuildConfiguration());
// Then
assertThat(result).isEqualTo("busybox:latest");
}
use of org.eclipse.jkube.kit.config.image.build.BuildConfiguration in project jkube by eclipse.
the class BuildUtilTest method extractBaseFromDockerfile_withNonExistentDockerfile_shouldReturnNull.
@Test
public void extractBaseFromDockerfile_withNonExistentDockerfile_shouldReturnNull() {
// Given
final JKubeConfiguration jKubeConfiguration = JKubeConfiguration.builder().sourceDirectory("src").project(JavaProject.builder().baseDirectory(new File(".")).build()).build();
final BuildConfiguration buildConfiguration = BuildConfiguration.builder().dockerFileFile(new File("Dockerfile")).build();
// When
final String result = extractBaseFromDockerfile(jKubeConfiguration, buildConfiguration);
// Then
assertThat(result).isNull();
}
use of org.eclipse.jkube.kit.config.image.build.BuildConfiguration in project jkube by eclipse.
the class BuildUtilTest method extractBaseFromConfiguration_withBuildConfigurationAssemblyAndFrom_shouldReturnFrom.
@Test
public void extractBaseFromConfiguration_withBuildConfigurationAssemblyAndFrom_shouldReturnFrom() {
// Given
final BuildConfiguration buildConfiguration = BuildConfiguration.builder().from("alpine:latest").assembly(new AssemblyConfiguration()).build();
// When
final String result = extractBaseFromConfiguration(buildConfiguration);
// Then
assertThat(result).isEqualTo("alpine:latest");
}
use of org.eclipse.jkube.kit.config.image.build.BuildConfiguration in project jkube by eclipse.
the class AssemblyConfigurationUtilsTest method createDockerFileBuilder_withEmptyBuildConfigurationNoAssembly_shouldReturnOnlyBase.
@Test
public void createDockerFileBuilder_withEmptyBuildConfigurationNoAssembly_shouldReturnOnlyBase() {
// Given
final BuildConfiguration buildConfig = BuildConfiguration.builder().build();
// When
final String result = createDockerFileBuilder(buildConfig, null, null).content();
// Then
assertThat(result).doesNotContain("COPY", "VOLUME").isEqualTo("FROM busybox\n");
}
Aggregations