use of org.mule.runtime.container.internal.MetadataInvocationHandler in project mule by mulesoft.
the class InjectParamsFromContextServiceProxyTestCase method throughProxyAugmentedInvocation.
@Test
public void throughProxyAugmentedInvocation() throws Exception {
BaseService service = new AugmentedMethodService();
final MetadataInvocationHandler noOpHandler = new MetadataInvocationHandler(service) {
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
return method.invoke(service, args);
}
};
final BaseService innerProxy = (BaseService) newProxyInstance(service.getClass().getClassLoader(), new Class<?>[] { BaseService.class }, noOpHandler);
final BaseService serviceProxy = (BaseService) createInjectProviderParamsServiceProxy(innerProxy, registry);
serviceProxy.augmented();
assertThat(augmentedParam, sameInstance(muleContext));
}
Aggregations