Adapt to change in exception hierarchy

See gh-44442
This commit is contained in:
Stéphane Nicoll 2025-02-27 09:38:26 +01:00
parent a9615f9b0d
commit facda3dca9
1 changed files with 4 additions and 1 deletions

View File

@ -46,6 +46,7 @@ import reactor.core.publisher.Mono;
import org.springframework.aot.AotDetector;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.BeanCurrentlyInCreationException;
import org.springframework.beans.factory.BeanDefinitionStoreException;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.UnsatisfiedDependencyException;
import org.springframework.beans.factory.annotation.Autowired;
@ -220,8 +221,10 @@ class SpringApplicationTests {
@Test
void sourcesMustBeAccessible() {
assertThatIllegalArgumentException()
assertThatExceptionOfType(BeanDefinitionStoreException.class)
.isThrownBy(() -> new SpringApplication(InaccessibleConfiguration.class).run())
.havingRootCause()
.isInstanceOf(IllegalArgumentException.class)
.withMessageContaining("No visible constructors");
}