@@ -251,7 +251,7 @@ public <T> AbstractObjectArrayAssert<?, String> getBeanNames(Class<T> type) {
251251 * given type
252252 */
253253 @ CheckReturnValue
254- public <T > AbstractObjectAssert <?, T > getBean (Class <T > type ) {
254+ public <T > AbstractObjectAssert <?, @ Nullable T > getBean (Class <T > type ) {
255255 return getBean (type , Scope .INCLUDE_ANCESTORS );
256256 }
257257
@@ -273,7 +273,7 @@ public <T> AbstractObjectAssert<?, T> getBean(Class<T> type) {
273273 * given type
274274 */
275275 @ CheckReturnValue
276- public <T > AbstractObjectAssert <?, T > getBean (Class <T > type , Scope scope ) {
276+ public <T > AbstractObjectAssert <?, @ Nullable T > getBean (Class <T > type , Scope scope ) {
277277 Assert .notNull (scope , "'scope' must not be null" );
278278 if (this .startupFailure != null ) {
279279 throwAssertionError (
@@ -334,7 +334,7 @@ private boolean isPrimary(String name, Scope scope) {
334334 * @throws AssertionError if the application context did not start
335335 */
336336 @ CheckReturnValue
337- public AbstractObjectAssert <?, Object > getBean (String name ) {
337+ public AbstractObjectAssert <?, @ Nullable Object > getBean (String name ) {
338338 if (this .startupFailure != null ) {
339339 throwAssertionError (
340340 contextFailedToStartWhenExpecting (this .startupFailure , "to contain a bean of name:%n <%s>" , name ));
@@ -362,7 +362,7 @@ public AbstractObjectAssert<?, Object> getBean(String name) {
362362 */
363363 @ SuppressWarnings ("unchecked" )
364364 @ CheckReturnValue
365- public <T > AbstractObjectAssert <?, T > getBean (String name , Class <T > type ) {
365+ public <T > AbstractObjectAssert <?, @ Nullable T > getBean (String name , Class <T > type ) {
366366 if (this .startupFailure != null ) {
367367 throwAssertionError (contextFailedToStartWhenExpecting (this .startupFailure ,
368368 "to contain a bean of name:%n <%s> (%s)" , name , type ));
0 commit comments