Fix logic for identifying test classes on Windows

Use File.separator rather than hard-coding the use of ‘/‘

Closes gh-1571
This commit is contained in:
Andy Wilkinson
2014-09-18 16:44:28 +01:00
parent bebcd60b7c
commit 6248fc0d60

View File

@@ -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) {