public Object handle(Invocation invocation) throws Throwable { try { Object returnedValue = mockHandler.handle(invocation); notifyMethodCall(invocation, returnedValue); return returnedValue; } catch (Throwable t){ notifyMethodCallException(invocation, t); throw t; } }
public static <T> MockHandler<T> createMockHandler(MockCreationSettings<T> settings) { MockHandler<T> handler = new MockHandlerImpl<T>(settings); MockHandler<T> nullResultGuardian = new NullResultGuardian<T>(handler); return new InvocationNotifierHandler<T>(nullResultGuardian, settings); } }
public InternalMockHandler create(MockCreationSettings settings) { InternalMockHandler handler = new MockHandlerImpl(settings); InternalMockHandler nullResultGuardian = new NullResultGuardian(handler); InternalMockHandler notifier = new InvocationNotifierHandler(nullResultGuardian, settings); return notifier; } }
public Object handle(Invocation invocation) throws Throwable { try { Object returnedValue = mockHandler.handle(invocation); notifyMethodCall(invocation, returnedValue); return returnedValue; } catch (Throwable t){ notifyMethodCallException(invocation, t); throw t; } }