This is my code (Jersey 1.4 + Mockito 1.8.5):
import org.junit.Test;
import static org.junit.Assert.*;
import com.sun.jersey.api.client.WebResource;
import static org.mockito.Mockito.*;
public FooTest {
@Test public shouldMakeAHttpCall() {
WebResource wr = mock(WebResource.class);
doReturn(wr).when(wr).accept(anyVararg());
doReturn("some text").when(wr).get(String.class);
}
}
Compiler says:
cannot find symbol: method accept(java.lang.Object)
location: class com.sun.jersey.api.client.WebResource
There is something wrong with anyVargarg()
, but what exactly?