MakeRequestClient client = makeNonSocialClient("owner", "owner", GADGET_URL);
TokenPair reqToken = serviceProvider.getPreapprovedToken("preapproved");
client.getBaseArgs().setRequestToken(reqToken.token);
client.getBaseArgs().setRequestTokenSecret(reqToken.secret);
HttpResponse response = client.sendGet(FakeOAuthServiceProvider.RESOURCE_URL);
assertEquals("User data is preapproved", response.getResponseAsString());
assertEquals(0, serviceProvider.getRequestTokenCount());
assertEquals(1, serviceProvider.getAccessTokenCount());
assertEquals(1, serviceProvider.getResourceAccessCount());
response = client.sendGet(FakeOAuthServiceProvider.RESOURCE_URL + "?cachebust=1");
assertEquals("User data is preapproved", response.getResponseAsString());
assertEquals(0, serviceProvider.getRequestTokenCount());
assertEquals(1, serviceProvider.getAccessTokenCount());
assertEquals(2, serviceProvider.getResourceAccessCount());
response = client.sendGet(FakeOAuthServiceProvider.RESOURCE_URL + "?cachebust=2");
assertEquals("User data is preapproved", response.getResponseAsString());
assertEquals(0, serviceProvider.getRequestTokenCount());
assertEquals(1, serviceProvider.getAccessTokenCount());
assertEquals(3, serviceProvider.getResourceAccessCount());
}