@Test public void test() throws Exception { InvocationContext context = mock(InvocationContext.class); Invocation invocation = mock(Invocation.class); when(invocation.getInvocationContext()).thenReturn(context); InvocationProxy proxy = new InvocationProxy(invocation); proxy.invoke(); verify(invocation).invoke(); verify(context).printProfiling(); }
public ValidationCode invoke() { InvocationContext context = invocation.getInvocationContext(); ValidationCode code; try { code = invocation.invoke(); } finally { logger.info("Whole time : {} ", context.printProfiling()); } return code; }
InvocationProxy { public ValidationCode invoke() { InvocationContext context = invocation.getInvocationContext(); ValidationCode code; try { code = invocation.invoke(); } finally { logger.info("Whole time : {} ", context.printProfiling()); } return code; } }
InvocationProxy { public ValidationCode invoke() { InvocationContext context = invocation.getInvocationContext(); ValidationCode code; try { code = invocation.invoke(); } finally { logger.info("Whole time : {} ", context.printProfiling()); } return code; } InvocationProxy(Invocation invocation); }
InvocationProxy { public ValidationCode invoke() { InvocationContext context = invocation.getInvocationContext(); ValidationCode code; try { code = invocation.invoke(); } finally { logger.info("Whole time : {} ", context.printProfiling()); } return code; } InvocationProxy(Invocation invocation); ValidationCode invoke(); }
InvocationProxy { public ValidationCode invoke() { InvocationContext context = invocation.getInvocationContext(); ValidationCode code; try { code = invocation.invoke(); } finally { logger.info("Whole time : {} ", context.printProfiling()); } return code; } InvocationProxy(Invocation invocation); ValidationCode invoke();  }