2626import org .assertj .core .api .AbstractObjectArrayAssert ;
2727import org .assertj .core .api .AbstractObjectAssert ;
2828import org .assertj .core .api .AbstractThrowableAssert ;
29- import org .assertj .core .api .Assertions ;
3029import org .assertj .core .api .MapAssert ;
3130import org .assertj .core .error .BasicErrorMessageFactory ;
3231
@@ -223,8 +222,8 @@ public <T> AbstractObjectArrayAssert<?, String> getBeanNames(Class<T> type) {
223222 if (this .startupFailure != null ) {
224223 throwAssertionError (contextFailedToStartWhenExpecting ("to get beans names with type:%n <%s>" , type ));
225224 }
226- return Assertions . assertThat (getApplicationContext ().getBeanNamesForType (type ))
227- . as ( "Bean names of type <%s> from <%s>" , type , getApplicationContext ());
225+ return assertThat (getApplicationContext ().getBeanNamesForType (type )). as ( "Bean names of type <%s> from <%s>" ,
226+ type , getApplicationContext ());
228227 }
229228
230229 /**
@@ -277,7 +276,7 @@ public <T> AbstractObjectAssert<?, T> getBean(Class<T> type, Scope scope) {
277276 getApplicationContext (), type , names ));
278277 }
279278 T bean = (name != null ) ? getApplicationContext ().getBean (name , type ) : null ;
280- return Assertions . assertThat (bean ).as ("Bean of type <%s> from <%s>" , type , getApplicationContext ());
279+ return assertThat (bean ).as ("Bean of type <%s> from <%s>" , type , getApplicationContext ());
281280 }
282281
283282 private String getPrimary (String [] names , Scope scope ) {
@@ -328,7 +327,7 @@ public AbstractObjectAssert<?, Object> getBean(String name) {
328327 throwAssertionError (contextFailedToStartWhenExpecting ("to contain a bean of name:%n <%s>" , name ));
329328 }
330329 Object bean = findBean (name );
331- return Assertions . assertThat (bean ).as ("Bean of name <%s> from <%s>" , name , getApplicationContext ());
330+ return assertThat (bean ).as ("Bean of name <%s> from <%s>" , name , getApplicationContext ());
332331 }
333332
334333 /**
@@ -360,8 +359,8 @@ public <T> AbstractObjectAssert<?, T> getBean(String name, Class<T> type) {
360359 "%nExpecting:%n <%s>%nto contain a bean of name:%n <%s> (%s)%nbut found:%n <%s> of type <%s>" ,
361360 getApplicationContext (), name , type , bean , bean .getClass ()));
362361 }
363- return Assertions . assertThat ((T ) bean )
364- . as ( "Bean of name <%s> and type <%s> from <%s>" , name , type , getApplicationContext ());
362+ return assertThat ((T ) bean ). as ( "Bean of name <%s> and type <%s> from <%s>" , name , type ,
363+ getApplicationContext ());
365364 }
366365
367366 private Object findBean (String name ) {
@@ -411,8 +410,8 @@ public <T> MapAssert<String, T> getBeans(Class<T> type, Scope scope) {
411410 if (this .startupFailure != null ) {
412411 throwAssertionError (contextFailedToStartWhenExpecting ("to get beans of type:%n <%s>" , type ));
413412 }
414- return Assertions . assertThat (scope .getBeansOfType (getApplicationContext (), type ))
415- . as ( "Beans of type <%s> from <%s>" , type , getApplicationContext ());
413+ return assertThat (scope .getBeansOfType (getApplicationContext (), type )). as ( "Beans of type <%s> from <%s>" , type ,
414+ getApplicationContext ());
416415 }
417416
418417 /**
@@ -482,7 +481,6 @@ public enum Scope {
482481 * Limited to the current context.
483482 */
484483 NO_ANCESTORS {
485-
486484 @ Override
487485 String [] getBeanNamesForType (ApplicationContext applicationContext , Class <?> type ) {
488486 return applicationContext .getBeanNamesForType (type );
@@ -499,7 +497,6 @@ <T> Map<String, T> getBeansOfType(ApplicationContext applicationContext, Class<T
499497 * Consider the ancestor contexts as well as the current context.
500498 */
501499 INCLUDE_ANCESTORS {
502-
503500 @ Override
504501 String [] getBeanNamesForType (ApplicationContext applicationContext , Class <?> type ) {
505502 return BeanFactoryUtils .beanNamesForTypeIncludingAncestors (applicationContext , type );
0 commit comments