diff --git a/spring-boot/src/main/java/org/springframework/boot/test/SpringApplicationContextLoader.java b/spring-boot/src/main/java/org/springframework/boot/test/SpringApplicationContextLoader.java
index <HASH>..<HASH> 100644
--- a/spring-boot/src/main/java/org/springframework/boot/test/SpringApplicationContextLoader.java
+++ b/spring-boot/src/main/java/org/springframework/boot/test/SpringApplicationContextLoader.java
@@ -212,7 +212,7 @@ public class SpringApplicationContextLoader extends AbstractContextLoader {
 	public void processContextConfiguration(
 			ContextConfigurationAttributes configAttributes) {
 		super.processContextConfiguration(configAttributes);
-		if (!configAttributes.hasLocations() && !configAttributes.hasClasses()) {
+		if (!configAttributes.hasResources()) {
 			Class<?>[] defaultConfigClasses = detectDefaultConfigurationClasses(configAttributes
 					.getDeclaringClass());
 			configAttributes.setClasses(defaultConfigClasses);
Polish d<I>bc<I>

Closes gh-<I>