@Test public void rethrowInternalExceptionThatThrownByInvocatedMethod() throws Exception { when(resourceMethod.getMethodParameters()).thenReturn(newArrayList(entityParameter)); InternalException thrownByMethod = new InternalException(new Exception()); thrown.expect(exceptionSameInstanceMatcher(thrownByMethod)); methodInvoker.invokeMethod(new EchoResource(thrownByMethod), resourceMethod, applicationContext); }
@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);  }