mirror of
https://github.com/google/nomulus.git
synced 2025-07-23 19:20:44 +02:00
Replace JacksonFactory with GsonFactory (#2173)
JacksonFactory is deprecated and GsonFactory is the recommended replacement.
This commit is contained in:
parent
7a84844000
commit
2da8ea0185
2 changed files with 5 additions and 5 deletions
|
@ -34,7 +34,7 @@ import com.google.api.client.http.HttpTransport;
|
|||
import com.google.api.client.http.LowLevelHttpRequest;
|
||||
import com.google.api.client.http.LowLevelHttpResponse;
|
||||
import com.google.api.client.json.Json;
|
||||
import com.google.api.client.json.jackson2.JacksonFactory;
|
||||
import com.google.api.client.json.gson.GsonFactory;
|
||||
import com.google.api.client.testing.http.HttpTesting;
|
||||
import com.google.api.client.testing.http.MockHttpTransport;
|
||||
import com.google.api.client.testing.http.MockLowLevelHttpRequest;
|
||||
|
@ -300,6 +300,6 @@ class DirectoryGroupsConnectionTest {
|
|||
HttpRequest request = transport.createRequestFactory()
|
||||
.buildGetRequest(HttpTesting.SIMPLE_GENERIC_URL)
|
||||
.setThrowExceptionOnExecuteError(false);
|
||||
return GoogleJsonResponseException.from(new JacksonFactory(), request.execute());
|
||||
return GoogleJsonResponseException.from(new GsonFactory(), request.execute());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ import com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets;
|
|||
import com.google.api.client.http.GenericUrl;
|
||||
import com.google.api.client.http.HttpRequest;
|
||||
import com.google.api.client.http.javanet.NetHttpTransport;
|
||||
import com.google.api.client.json.jackson2.JacksonFactory;
|
||||
import com.google.api.client.json.gson.GsonFactory;
|
||||
import com.google.api.client.util.store.AbstractDataStoreFactory;
|
||||
import com.google.api.client.util.store.DataStore;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
@ -74,7 +74,7 @@ class AuthModuleTest {
|
|||
// We need to set the following fields because they are checked when
|
||||
// Credential#setRefreshToken is called. However they are not actually persisted in the
|
||||
// DataStore and not actually used in tests.
|
||||
.setJsonFactory(new JacksonFactory())
|
||||
.setJsonFactory(new GsonFactory())
|
||||
.setTransport(new NetHttpTransport())
|
||||
.setTokenServerUrl(new GenericUrl("https://accounts.google.com/o/oauth2/token"))
|
||||
.setClientAuthentication(new ClientParametersAuthentication(CLIENT_ID, CLIENT_SECRET))
|
||||
|
@ -146,7 +146,7 @@ class AuthModuleTest {
|
|||
private Credential getCredential() {
|
||||
// Reconstruct the entire dependency graph, injecting FakeDataStoreFactory and credential
|
||||
// parameters.
|
||||
JacksonFactory jsonFactory = new JacksonFactory();
|
||||
GsonFactory jsonFactory = new GsonFactory();
|
||||
GoogleClientSecrets clientSecrets = getSecrets();
|
||||
ImmutableList<String> scopes = ImmutableList.of("scope1");
|
||||
return AuthModule.provideCredential(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue