use of org.apache.cayenne.di.mock.MockInterface1_Decorator2 in project cayenne by apache.
the class DefaultInjectorDecorationTest method testDecoratorChain.
@Test
public void testDecoratorChain() {
Module module = binder -> {
binder.bind(MockInterface1.class).to(MockImplementation1.class);
binder.decorate(MockInterface1.class).before(MockInterface1_Decorator1.class);
binder.decorate(MockInterface1.class).before(MockInterface1_Decorator2.class);
binder.decorate(MockInterface1.class).after(MockInterface1_Decorator3.class);
};
DefaultInjector injector = new DefaultInjector(module);
MockInterface1 service = injector.getInstance(MockInterface1.class);
assertNotNull(service);
assertEquals("<[{MyName}]>", service.getName());
}
Aggregations