Skip to content

Commit

Permalink
Merge branch '3.3.x'
Browse files Browse the repository at this point in the history
Closes gh-43507
  • Loading branch information
philwebb committed Dec 14, 2024
2 parents 2fe1a93 + 6d09459 commit 940ff95
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -243,8 +243,11 @@ private Class<?> findConfigurationClass(Class<?> testClass) {
return ClassUtils.resolveClassName(foundClassName, testClass.getClassLoader());
}
Class<?> found = new AnnotatedClassFinder(SpringBootConfiguration.class).findFromClass(testClass);
Assert.state(found != null, "Unable to find a @SpringBootConfiguration, you need to use "
+ "@ContextConfiguration or @SpringBootTest(classes=...) with your test");
Assert.state(found != null,
"Unable to find a @SpringBootConfiguration by searching packages upwards from the test. "
+ "You can use @ContextConfiguration, @SpringBootTest(classes=...) or other Spring Test "
+ "supported mechanisms to explicitly declare the configuration classes to load. Classes "
+ "annotated with @TestConfiguration are not considered.");
this.aotTestAttributes.setAttribute(propertyName, found.getName());
return found;
}
Expand Down

0 comments on commit 940ff95

Please sign in to comment.