Skip to content

Commit 6248fc0

Browse files
committed
Fix logic for identifying test classes on Windows
Use File.separator rather than hard-coding the use of ‘/‘ Closes gh-1571
1 parent bebcd60 commit 6248fc0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spring-boot/src/test/java/org/springframework/boot/test/AbstractConfigurationClassTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.boot.test;
1818

19+
import java.io.File;
1920
import java.io.IOException;
2021
import java.util.HashSet;
2122
import java.util.Set;
@@ -81,7 +82,8 @@ private Set<AnnotationMetadata> findConfigurationClasses() throws IOException {
8182
}
8283

8384
private boolean isTestClass(Resource resource) throws IOException {
84-
return resource.getFile().getAbsolutePath().contains("target/test-classes");
85+
return resource.getFile().getAbsolutePath()
86+
.contains("target" + File.separator + "test-classes");
8587
}
8688

8789
private boolean isPublic(MethodMetadata methodMetadata) {

0 commit comments

Comments
 (0)