}
@Test
public void givenManyConstructorsWhenInstantiateThenChooseCorrectConstructor()
{
SingletonAssembler assembler = new SingletonAssembler()
{
public void assemble( ModuleAssembly module )
throws AssemblyException
{
module.objects( ManyConstructorObject.class );
}
};
ManyConstructorObject object = assembler.module().newObject( ManyConstructorObject.class );
Assert.assertThat( "ref is not null", object.anyObject, notNullValue() );
object = assembler.module()
.newObject( ManyConstructorObject.class, new AnyObject() );
Assert.assertThat( "ref is not null", object.anyObject, notNullValue() );
}