mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-23 01:39:02 +00:00
Use MergedContextConfiguration.hasResources()
Simplify the code by using MergedContextConfiguration.hasResources(). See gh-49504
This commit is contained in:
committed by
Andy Wilkinson
parent
c49ebaa970
commit
7306fd04de
+1
-3
@@ -153,9 +153,7 @@ public class SpringBootContextLoader extends AbstractContextLoader implements Ao
|
||||
}
|
||||
|
||||
private void assertHasClassesOrLocations(MergedContextConfiguration mergedConfig) {
|
||||
boolean hasClasses = !ObjectUtils.isEmpty(mergedConfig.getClasses());
|
||||
boolean hasLocations = !ObjectUtils.isEmpty(mergedConfig.getLocations());
|
||||
Assert.state(hasClasses || hasLocations,
|
||||
Assert.state(mergedConfig.hasResources(),
|
||||
() -> "No configuration classes or locations found in @SpringApplicationConfiguration. "
|
||||
+ "For default configuration detection to work you need Spring 4.0.3 or better (found "
|
||||
+ SpringVersion.getVersion() + ").");
|
||||
|
||||
Reference in New Issue
Block a user