diff --git a/spring-boot/src/test/java/org/springframework/boot/test/AbstractConfigurationClassTests.java b/spring-boot/src/test/java/org/springframework/boot/test/AbstractConfigurationClassTests.java index 0e76e80da4..7ab38c8e71 100644 --- a/spring-boot/src/test/java/org/springframework/boot/test/AbstractConfigurationClassTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/test/AbstractConfigurationClassTests.java @@ -16,6 +16,7 @@ package org.springframework.boot.test; +import java.io.File; import java.io.IOException; import java.util.HashSet; import java.util.Set; @@ -81,7 +82,8 @@ public abstract class AbstractConfigurationClassTests { } private boolean isTestClass(Resource resource) throws IOException { - return resource.getFile().getAbsolutePath().contains("target/test-classes"); + return resource.getFile().getAbsolutePath() + .contains("target" + File.separator + "test-classes"); } private boolean isPublic(MethodMetadata methodMetadata) {