use of org.apache.cayenne.di.mock.MockImplementation4 in project cayenne by apache.
the class DefaultInjectorInjectionTest method testConstructorInjection.
@Test
public void testConstructorInjection() {
Module module = binder -> {
binder.bind(MockInterface1.class).to(MockImplementation1.class);
binder.bind(MockInterface4.class).to(MockImplementation4.class);
};
DefaultInjector injector = new DefaultInjector(module);
MockInterface4 service = injector.getInstance(MockInterface4.class);
assertNotNull(service);
assertEquals("constructor_MyName", service.getName());
}
Aggregations