From baa728c85e505189343790bd85a7e260dcaf7446 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Mon, 6 Apr 2020 20:17:16 -0700 Subject: [PATCH] Cleanup paths to fix tests running on Windows --- .../boot/gradle/tasks/bundling/BootJarIntegrationTests.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests.java index 5f8b40e9d8..5c57610538 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests.java @@ -44,6 +44,7 @@ import org.gradle.testkit.runner.UnexpectedBuildFailure; import org.junit.jupiter.api.TestTemplate; import org.springframework.boot.loader.tools.JarModeLibrary; +import org.springframework.util.StringUtils; import static org.assertj.core.api.Assertions.assertThat; @@ -257,8 +258,9 @@ class BootJarIntegrationTests extends AbstractBootArchiveIntegrationTests { for (String layerName : layerNames) { File layer = new File(root, layerName); assertThat(layer).isDirectory(); - extractedLayers.put(layerName, Files.walk(layer.toPath()).filter((path) -> path.toFile().isFile()) - .map(layer.toPath()::relativize).map(Path::toString).collect(Collectors.toList())); + extractedLayers.put(layerName, + Files.walk(layer.toPath()).filter((path) -> path.toFile().isFile()).map(layer.toPath()::relativize) + .map(Path::toString).map(StringUtils::cleanPath).collect(Collectors.toList())); } return extractedLayers; }