mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Merge branch '4.0.x'
Closes gh-50845
This commit is contained in:
+4
-4
@@ -251,7 +251,7 @@ public class ApplicationContextAssert<C extends ApplicationContext>
|
||||
* given type
|
||||
*/
|
||||
@CheckReturnValue
|
||||
public <T> AbstractObjectAssert<?, T> getBean(Class<T> type) {
|
||||
public <T> AbstractObjectAssert<?, @Nullable T> getBean(Class<T> type) {
|
||||
return getBean(type, Scope.INCLUDE_ANCESTORS);
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ public class ApplicationContextAssert<C extends ApplicationContext>
|
||||
* given type
|
||||
*/
|
||||
@CheckReturnValue
|
||||
public <T> AbstractObjectAssert<?, T> getBean(Class<T> type, Scope scope) {
|
||||
public <T> AbstractObjectAssert<?, @Nullable T> getBean(Class<T> type, Scope scope) {
|
||||
Assert.notNull(scope, "'scope' must not be null");
|
||||
if (this.startupFailure != null) {
|
||||
throwAssertionError(
|
||||
@@ -334,7 +334,7 @@ public class ApplicationContextAssert<C extends ApplicationContext>
|
||||
* @throws AssertionError if the application context did not start
|
||||
*/
|
||||
@CheckReturnValue
|
||||
public AbstractObjectAssert<?, Object> getBean(String name) {
|
||||
public AbstractObjectAssert<?, @Nullable Object> getBean(String name) {
|
||||
if (this.startupFailure != null) {
|
||||
throwAssertionError(
|
||||
contextFailedToStartWhenExpecting(this.startupFailure, "to contain a bean of name:%n <%s>", name));
|
||||
@@ -362,7 +362,7 @@ public class ApplicationContextAssert<C extends ApplicationContext>
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@CheckReturnValue
|
||||
public <T> AbstractObjectAssert<?, T> getBean(String name, Class<T> type) {
|
||||
public <T> AbstractObjectAssert<?, @Nullable T> getBean(String name, Class<T> type) {
|
||||
if (this.startupFailure != null) {
|
||||
throwAssertionError(contextFailedToStartWhenExpecting(this.startupFailure,
|
||||
"to contain a bean of name:%n <%s> (%s)", name, type));
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ kotlinVersion=2.3.21
|
||||
mavenVersion=3.9.13
|
||||
mockitoVersion=5.23.0
|
||||
nativeBuildToolsVersion=1.1.1
|
||||
nullabilityPluginVersion=0.0.11
|
||||
nullabilityPluginVersion=0.0.14
|
||||
snakeYamlVersion=2.6
|
||||
springGrpcVersion=1.1.0
|
||||
springFrameworkVersion=7.0.8
|
||||
|
||||
Reference in New Issue
Block a user