AssertionError - if the application context did not start
getBean
public <T> org.assertj.core.api.AbstractObjectAssert<?,T> getBean(Class<T> type)
Obtain a single bean of the given type from the application context (or ancestors),
the bean becoming the object under test. If no beans of the specified type can be
found an assert on null is returned.
Obtain a single bean of the given type from the application context, the bean
becoming the object under test. If no beans of the specified type can be found an
assert on null is returned.
bean assertions for the bean, or an assert on null if the no bean
is found
Throws:
AssertionError - if the application context did not start
AssertionError - if the application context contains multiple beans of the
given type
getBean
public org.assertj.core.api.AbstractObjectAssert<?,Object> getBean(String name)
Obtain a single bean of the given name from the application context, the bean
becoming the object under test. If no bean of the specified name can be found an
assert on null is returned.
bean assertions for the bean, or an assert on null if the no bean
is found
Throws:
AssertionError - if the application context did not start
getBean
public <T> org.assertj.core.api.AbstractObjectAssert<?,T> getBean(String name,
Class<T> type)
Obtain a single bean of the given name and type from the application context, the
bean becoming the object under test. If no bean of the specified name can be found
an assert on null is returned.
bean assertions for the bean, or an assert on null if the no bean
is found
Throws:
AssertionError - if the application context did not start
AssertionError - if the application context contains a bean with the given
name but a different type
getBeans
public <T> org.assertj.core.api.MapAssert<String,T> getBeans(Class<T> type)
Obtain a map bean names and instances of the given type from the application
context (or ancestors), the map becoming the object under test. If no bean of the
specified type can be found an assert on an empty map is returned.
Obtain a map bean names and instances of the given type from the application
context, the map becoming the object under test. If no bean of the specified type
can be found an assert on an empty map is returned.