@@ -248,7 +248,7 @@ public <T> AbstractObjectArrayAssert<?, String> getBeanNames(Class<T> type) {
248248 * @throws AssertionError if the application context contains multiple beans of the
249249 * given type
250250 */
251- public <T > AbstractObjectAssert <?, T > getBean (Class <T > type ) {
251+ public <T > AbstractObjectAssert <?, @ Nullable T > getBean (Class <T > type ) {
252252 return getBean (type , Scope .INCLUDE_ANCESTORS );
253253 }
254254
@@ -269,7 +269,7 @@ public <T> AbstractObjectAssert<?, T> getBean(Class<T> type) {
269269 * @throws AssertionError if the application context contains multiple beans of the
270270 * given type
271271 */
272- public <T > AbstractObjectAssert <?, T > getBean (Class <T > type , Scope scope ) {
272+ public <T > AbstractObjectAssert <?, @ Nullable T > getBean (Class <T > type , Scope scope ) {
273273 Assert .notNull (scope , "'scope' must not be null" );
274274 if (this .startupFailure != null ) {
275275 throwAssertionError (
@@ -329,7 +329,7 @@ private boolean isPrimary(String name, Scope scope) {
329329 * is found
330330 * @throws AssertionError if the application context did not start
331331 */
332- public AbstractObjectAssert <?, Object > getBean (String name ) {
332+ public AbstractObjectAssert <?, @ Nullable Object > getBean (String name ) {
333333 if (this .startupFailure != null ) {
334334 throwAssertionError (
335335 contextFailedToStartWhenExpecting (this .startupFailure , "to contain a bean of name:%n <%s>" , name ));
@@ -356,7 +356,7 @@ public AbstractObjectAssert<?, Object> getBean(String name) {
356356 * name but a different type
357357 */
358358 @ SuppressWarnings ("unchecked" )
359- public <T > AbstractObjectAssert <?, T > getBean (String name , Class <T > type ) {
359+ public <T > AbstractObjectAssert <?, @ Nullable T > getBean (String name , Class <T > type ) {
360360 if (this .startupFailure != null ) {
361361 throwAssertionError (contextFailedToStartWhenExpecting (this .startupFailure ,
362362 "to contain a bean of name:%n <%s> (%s)" , name , type ));
0 commit comments