private static final GenericUrl TOKEN_SERVER_URL = new GenericUrl("http://example.com/token");
private Credential createCredential() {
return new Credential.Builder(BearerToken.queryParameterAccessMethod()).setTransport(
new MockHttpTransport())
.setJsonFactory(new MockJsonFactory())
.setTokenServerUrl(TOKEN_SERVER_URL)
.setClientAuthentication(new BasicAuthentication(CLIENT_ID, CLIENT_SECRET))
.build()
.setAccessToken(ACCESS_TOKEN)
.setRefreshToken(REFRESH_TOKEN)