You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we try spring boot test without @SpringBootConfiguration,NPE exception will occur.
Before supporting AOT,it throws IllegalStateException with message:
Unable to find a @SpringBootConfiguration, you need to use "
+ "@ContextConfiguration or @SpringBootTest(classes=...) with your test
but now it occurs exception like this:
java.lang.NullPointerException: Cannot invoke "java.lang.Class.getName()" because "found" is null
at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.findConfigurationClass(SpringBootTestContextBootstrapper.java:261)
I find that class is not checking null before setting aotTestAttributes :
Class<?> found = newAnnotatedClassFinder(SpringBootConfiguration.class).findFromClass(testClass);
this.aotTestAttributes.setAttribute(propertyName, found.getName());
We can avoid this with a small change by checking whether class with @SpringBootConfiguration is null in advance.We can move checking code from getOrFindConfigurationClasses to findConfigurationClass before setting aotTestAttributes
The text was updated successfully, but these errors were encountered:
When we try spring boot test without
@SpringBootConfiguration
,NPE exception will occur.Before supporting AOT,it throws IllegalStateException with message:
but now it occurs exception like this:
I find that class is not checking null before setting aotTestAttributes :
We can avoid this with a small change by checking whether class with
@SpringBootConfiguration
is null in advance.We can move checking code fromgetOrFindConfigurationClasses
tofindConfigurationClass
before setting aotTestAttributesThe text was updated successfully, but these errors were encountered: