Skip to content

Commit

Permalink
test: fixed failing tests (windows) in jkube-kit/config/service module (
Browse files Browse the repository at this point in the history
  • Loading branch information
l3002 authored Mar 18, 2024
1 parent e72e5d4 commit ddbf861
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import java.util.Map;
import java.util.Properties;

import static org.apache.commons.io.FilenameUtils.separatorsToSystem;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.mockito.ArgumentMatchers.argThat;
Expand Down Expand Up @@ -150,15 +151,15 @@ void build_withLayersAndArtifact_shouldPerformJibBuild() throws Exception {
.containsExactlyInAnyOrder(
"Dockerfile",
"deployments-layer",
"deployments-layer/deployments",
"deployments-layer/deployments/to-deployments.txt",
separatorsToSystem("deployments-layer/deployments"),
separatorsToSystem("deployments-layer/deployments/to-deployments.txt"),
"other-layer",
"other-layer/deployments",
"other-layer/deployments/other",
"other-layer/deployments/other/to-other.txt",
separatorsToSystem("other-layer/deployments"),
separatorsToSystem("other-layer/deployments/other"),
separatorsToSystem("other-layer/deployments/other/to-other.txt"),
"jkube-generated-layer-final-artifact",
"jkube-generated-layer-final-artifact/deployments",
"jkube-generated-layer-final-artifact/deployments/final-artifact.jar",
separatorsToSystem("jkube-generated-layer-final-artifact/deployments"),
separatorsToSystem("jkube-generated-layer-final-artifact/deployments/final-artifact.jar"),
"deployments"
);
ArchiveAssertions.assertThat(dockerDir.resolve("tmp").resolve("docker-build.tar").toFile())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void init(@TempDir Path temporaryFolder) throws Exception {
.thenReturn(new ArchiveService(AssemblyManager.getInstance(), logger));
when(jKubeServiceHub.getBuildServiceConfig().getBuildDirectory()).thenReturn(target.getAbsolutePath());
when(jKubeServiceHub.getConfiguration()).thenReturn(JKubeConfiguration.builder()
.outputDirectory(target.getAbsolutePath())
.outputDirectory(target.getName())
.project(JavaProject.builder()
.baseDirectory(baseDirectory)
.buildDirectory(target)
Expand Down Expand Up @@ -238,7 +238,7 @@ void build_withDockerfileModeAndFlattenedAssembly_shouldThrowException() {
@Test
void build_withDockerfileModeAndAssembly_shouldSucceed() throws Exception {
//Given
final File dockerFile = new File(target, "Dockerfile");
final File dockerFile = new File(baseDirectory, "Dockerfile");
FileUtils.write(dockerFile, "FROM busybox\n", StandardCharsets.UTF_8);
image.setBuild(BuildConfiguration.builder()
.from(projectName)
Expand Down

0 comments on commit ddbf861

Please sign in to comment.