From 1787d88509a88d2b19770752ae4126fcab99dc9f Mon Sep 17 00:00:00 2001 From: subhramit Date: Sat, 13 Jun 2026 01:23:06 +0530 Subject: [PATCH] Add missing `@Nullable` annotations to getBean signatures in `ApplicationContextAssert.java` Signed-off-by: subhramit --- .../boot/test/context/assertj/ApplicationContextAssert.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/ApplicationContextAssert.java b/core/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/ApplicationContextAssert.java index 4b3880e56831..8ad8b588c9a1 100644 --- a/core/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/ApplicationContextAssert.java +++ b/core/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/ApplicationContextAssert.java @@ -251,7 +251,7 @@ public AbstractObjectArrayAssert getBeanNames(Class type) { * given type */ @CheckReturnValue - public AbstractObjectAssert getBean(Class type) { + public AbstractObjectAssert getBean(Class type) { return getBean(type, Scope.INCLUDE_ANCESTORS); } @@ -334,7 +334,7 @@ private boolean isPrimary(String name, Scope scope) { * @throws AssertionError if the application context did not start */ @CheckReturnValue - public AbstractObjectAssert getBean(String name) { + public AbstractObjectAssert 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 AbstractObjectAssert getBean(String name) { */ @SuppressWarnings("unchecked") @CheckReturnValue - public AbstractObjectAssert getBean(String name, Class type) { + public AbstractObjectAssert getBean(String name, Class type) { if (this.startupFailure != null) { throwAssertionError(contextFailedToStartWhenExpecting(this.startupFailure, "to contain a bean of name:%n <%s> (%s)", name, type));