getBeans
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.
Example:
assertThat(context).getBeans(Foo.class).containsKey("foo");
Return
bean assertions for the beans, or an assert on an empty map
if theno beans are found
Parameters
the bean type
the bean type
Throws
if the application context did not start
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.
Example:
assertThat(context).getBeans(Foo.class, Scope.NO_ANCESTORS).containsKey("foo");
Return
bean assertions for the beans, or an assert on an empty map
if theno beans are found
Parameters
the bean type
the bean type
the scope of the assertion
Throws
if the application context did not start