@Test public void notifiesMethodInvokerFiltersBeforeMethodInvocation() throws Exception { MethodInvokerFilter methodInvokerFilter = mock(MethodInvokerFilter.class); when(resourceMethod.getMethodParameters()).thenReturn(newArrayList(entityParameter)); when(applicationContext.getProviders().getMethodInvokerFilters(RESOURCE_PATH)).thenReturn(newArrayList(methodInvokerFilter)); methodInvoker.invokeMethod(new EchoResource(), resourceMethod, applicationContext); verify(methodInvokerFilter).accept(eq(resourceMethod), aryEq(new Object[]{ARGUMENT_VALUE})); }
@Override public final Object invokeMethod(Object resource, GenericResourceMethod methodResource, ApplicationContext context) { Object[] params = makeMethodParameters(methodResource, context); beforeInvokeMethod(resource, methodResource, params, context); return invokeMethod(resource, methodResource, params, context); }
DefaultMethodInvoker implements MethodInvoker { @Override public final Object invokeMethod(Object resource, GenericResourceMethod methodResource, ApplicationContext context) { Object[] params = makeMethodParameters(methodResource, context); beforeInvokeMethod(resource, methodResource, params, context); return invokeMethod(resource, methodResource, params, context); } }
DefaultMethodInvoker implements MethodInvoker { @Override public final Object invokeMethod(Object resource, GenericResourceMethod methodResource, ApplicationContext context) { Object[] params = makeMethodParameters(methodResource, context); beforeInvokeMethod(resource, methodResource, params, context); return invokeMethod(resource, methodResource, params, context); } DefaultMethodInvoker(ParameterResolverFactory parameterResolverFactory); }
DefaultMethodInvoker implements MethodInvoker { @Override public final Object invokeMethod(Object resource, GenericResourceMethod methodResource, ApplicationContext context) { Object[] params = makeMethodParameters(methodResource, context); beforeInvokeMethod(resource, methodResource, params, context); return invokeMethod(resource, methodResource, params, context); } DefaultMethodInvoker(ParameterResolverFactory parameterResolverFactory); @Override final Object invokeMethod(Object resource, GenericResourceMethod methodResource, ApplicationContext context); Object invokeMethod(Object resource, GenericResourceMethod methodResource, Object[] params, ApplicationContext context); }
DefaultMethodInvoker implements MethodInvoker { @Override public final Object invokeMethod(Object resource, GenericResourceMethod methodResource, ApplicationContext context) { Object[] params = makeMethodParameters(methodResource, context); beforeInvokeMethod(resource, methodResource, params, context); return invokeMethod(resource, methodResource, params, context); } DefaultMethodInvoker(ParameterResolverFactory parameterResolverFactory); @Override final Object invokeMethod(Object resource, GenericResourceMethod methodResource, ApplicationContext context); Object invokeMethod(Object resource, GenericResourceMethod methodResource, Object[] params, ApplicationContext context);  }