@RuntimeType public static Object intercept(@This AbstractAssert<?, ?> assertion, @SuperCall Callable<Object> proxy) throws Exception { try { Object result = proxy.call(); if (result != assertion && result instanceof AbstractAssert) { return asAssumption((AbstractAssert<?, ?>) result).withAssertionState(assertion); } return result; } catch (AssertionError e) { throw assumptionNotMet(e); } } }
@RuntimeType public static Object intercept(@This AbstractAssert<?, ?> assertion, @SuperCall Callable<Object> proxy) throws Exception { try { Object result = proxy.call(); if (result != assertion && result instanceof AbstractAssert) { return asAssumption((AbstractAssert<?, ?>) result).withAssertionState(assertion); } return result; } catch (AssertionError e) { throw assumptionNotMet(e); } } }
@RuntimeType public static AbstractAssert<?, ?> intercept(@FieldValue(FIELD_NAME) ProxifyMethodChangingTheObjectUnderTest dispatcher, @SuperCall Callable<AbstractAssert<?, ?>> assertionMethod, @This AbstractAssert<?, ?> currentAssertInstance) throws Exception { Object result = assertionMethod.call(); return dispatcher.createAssertProxy(result).withAssertionState(currentAssertInstance); }
@RuntimeType public static AbstractAssert<?, ?> intercept(@FieldValue(FIELD_NAME) ProxifyMethodChangingTheObjectUnderTest dispatcher, @SuperCall Callable<AbstractAssert<?, ?>> assertionMethod, @This AbstractAssert<?, ?> currentAssertInstance) throws Exception { Object result = assertionMethod.call(); return dispatcher.createAssertProxy(result).withAssertionState(currentAssertInstance); }
public static Object intercept(@FieldValue(FIELD_NAME) ErrorCollector errorCollector, @This Object assertion, @SuperCall Callable<?> proxy, @SuperMethod(nullIfImpossible = true) Method method, @StubValue Object stub) throws Exception {
@SuppressWarnings("unused") @RuntimeType @BindingPriority(BindingPriority.DEFAULT * 2) public static Object interceptSuperCallable(@This Object mock, @FieldValue("mockitoInterceptor") MockMethodInterceptor interceptor, @Origin Method invokedMethod, @AllArguments Object[] arguments, @SuperCall(serializableProxy = true) Callable<?> superCall) throws Throwable { if (interceptor == null) { return superCall.call(); } return interceptor.doIntercept( mock, invokedMethod, arguments, new RealMethod.FromCallable(superCall) ); }
public static Object intercept(@FieldValue(FIELD_NAME) ErrorCollector errorCollector, @This Object assertion, @SuperCall Callable<?> proxy, @SuperMethod(nullIfImpossible = true) Method method, @StubValue Object stub) throws Exception {
@RuntimeType public Object intercept(@Origin Method method, @SuperCall Callable<?> superMethod, @AllArguments Object[] args, @This Object me, @FieldValue("liveObjectLiveMap") RMap<String, Object> liveMap) throws Exception {
@RuntimeType public Object intercept(@Origin Method method, @SuperCall Callable<?> superMethod, @AllArguments Object[] args, @This Object me, @FieldValue("liveObjectLiveMap") RMap<String, Object> liveMap) throws Exception {
public @Nullable Connection connect(final String url, final java.util.Properties info, @SuperCall final Callable<@Nullable Connection> originalConnectionCreator) throws Exception { return WrappingDriver.INSTANCE.wrapConnection(url, info, originalConnectionCreator); } }
@RuntimeType public Object invoke(@SuperCall Callable<Object> superMethod, @Origin Method method, @AllArguments @RuntimeType Object[] args) throws Exception{
@RuntimeType public static Object intercept(@SuperCall Callable<?> callable, @AllArguments Object... args) throws Exception {
@RuntimeType @BindingPriority(BindingPriority.DEFAULT * 2) public static Object intercept(@ProxyAdviceId long id, @This Object self, @Origin Method method, @AllArguments Object[] args, @SuperCall final Callable<Object> originalMethod) throws Throwable { JvmMockKDispatcher dispatcher = get(id, self); if (dispatcher == null) { return originalMethod.call(); } return dispatcher.handle(self, method, args, originalMethod); }
@RuntimeType @BindingPriority( BindingPriority.DEFAULT * 3 ) public Object interceptSuper( @SuperCall final Callable<?> zuper, @This final Object receiver, @Origin Method method, @AllArguments final Object[] parameters, @FieldProxy( INTERCEPTOR_FIELD_NAME ) StepInterceptorGetterSetter stepInterceptorGetter ) throws Throwable { StepInterceptor interceptor = (StepInterceptor) stepInterceptorGetter.getValue(); if( interceptor == null ) { return zuper.call(); } Invoker invoker = new Invoker() { @Override public Object proceed() throws Throwable { return zuper.call(); } }; return interceptor.intercept( receiver, method, parameters, invoker ); }
@RuntimeType @BindingPriority(BindingPriority.DEFAULT * 2) public static Object intercept(@This Object self, @Origin Method method, @AllArguments Object[] args, @SuperCall final Callable<Object> originalMethod) throws Throwable { MockKInvocationHandler handler = MockKInstrumentation.INSTANCE.getHook(self); if (handler == null || MockKSelfCall.isSelf(self, method)) { return originalMethod.call(); } return handler.invocation( self, method, new MockKSkipInterceptingSelf(originalMethod, self, method), args); }
@RuntimeType public Object intercept(@Origin Method method, @SuperCall Callable<?> superMethod, @AllArguments Object[] args, @This Object me, @FieldValue("liveObjectLiveMap") RMap<String, Object> liveMap) throws Exception {