hasSingleBean

Verifies that the application context (or ancestors) contains a single bean with the given type.

Example:

	assertThat(context).hasSingleBean(Foo.class); 

Return

this assertion object.

Parameters

type

the bean type

Throws

if the application context contains multiple beans of thegiven type


Verifies that the application context contains a single bean with the given type.

Example:

	assertThat(context).hasSingleBean(Foo.class, Scope.NO_ANCESTORS); 

Return

this assertion object.

Parameters

type

the bean type

scope

the scope of the assertion

Throws

if the application context contains multiple beans of thegiven type