Skip to content

Commit 940ff95

Browse files
committed
Merge branch '3.3.x'
Closes gh-43507
2 parents 2fe1a93 + 6d09459 commit 940ff95

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTestContextBootstrapper.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -243,8 +243,11 @@ private Class<?> findConfigurationClass(Class<?> testClass) {
243243
return ClassUtils.resolveClassName(foundClassName, testClass.getClassLoader());
244244
}
245245
Class<?> found = new AnnotatedClassFinder(SpringBootConfiguration.class).findFromClass(testClass);
246-
Assert.state(found != null, "Unable to find a @SpringBootConfiguration, you need to use "
247-
+ "@ContextConfiguration or @SpringBootTest(classes=...) with your test");
246+
Assert.state(found != null,
247+
"Unable to find a @SpringBootConfiguration by searching packages upwards from the test. "
248+
+ "You can use @ContextConfiguration, @SpringBootTest(classes=...) or other Spring Test "
249+
+ "supported mechanisms to explicitly declare the configuration classes to load. Classes "
250+
+ "annotated with @TestConfiguration are not considered.");
248251
this.aotTestAttributes.setAttribute(propertyName, found.getName());
249252
return found;
250253
}

0 commit comments

Comments
 (0)