use of org.apache.cayenne.di.mock.MockImplementation2Sub1 in project cayenne by apache.
the class DefaultInjectorInjectionTest method testFieldInjectionSuperclass.
@Test
public void testFieldInjectionSuperclass() {
Module module = binder -> {
binder.bind(MockInterface1.class).to(MockImplementation1.class);
binder.bind(MockInterface2.class).to(MockImplementation2Sub1.class);
binder.bind(MockInterface3.class).to(MockImplementation3.class);
};
DefaultInjector injector = new DefaultInjector(module);
MockInterface2 service = injector.getInstance(MockInterface2.class);
assertNotNull(service);
assertEquals("altered_MyName:XName", service.getAlteredName());
}
Aggregations