Disable default configuration detection in @SpringApplicationConfiguration
This is a holding pattern until SPR-11455 is fixed. We now throw an exception with a helpful message instead of ttrying to detect default configuration. Fixes gh-380
This commit is contained in:
@@ -91,9 +91,9 @@ public class SpringApplicationContextLoader extends AbstractContextLoader {
|
||||
sources.addAll(Arrays.asList(mergedConfig.getClasses()));
|
||||
sources.addAll(Arrays.asList(mergedConfig.getLocations()));
|
||||
if (sources.isEmpty()) {
|
||||
Class<?>[] defaultConfigClasses = detectDefaultConfigurationClasses(mergedConfig
|
||||
.getTestClass());
|
||||
sources.addAll(Arrays.asList(defaultConfigClasses));
|
||||
throw new IllegalStateException(
|
||||
"No configuration resources found (use classes= or locations= in @SpringApplicationConfiguration). "
|
||||
+ "Default configuration detection is not supported with this loader (see SPR-11455 for details)");
|
||||
}
|
||||
return sources;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.boot.test;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -32,6 +33,7 @@ import static org.junit.Assert.assertNotNull;
|
||||
*/
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringApplicationConfiguration
|
||||
@Ignore("Ignore until gh-380, SPR-11455 can be resolved")
|
||||
public class SpringApplicationConfigurationDefaultConfigurationTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
Reference in New Issue
Block a user