com.googlecode.gwt.test.GwtStubberImpl Maven / Gradle / Ivy
package com.googlecode.gwt.test;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.googlecode.gwt.test.mockito.GwtStubber;
import org.mockito.internal.stubbing.StubberImpl;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
class GwtStubberImpl extends StubberImpl implements GwtStubber {
private static class FailureAnswer implements Answer {
private final Throwable result;
public FailureAnswer(Throwable result) {
this.result = result;
}
@SuppressWarnings("unchecked")
public T answer(InvocationOnMock invocation) {
Object[] arguments = invocation.getArguments();
AsyncCallback