1 package com.google.auth.oauth2; 2 3 import com.google.api.client.testing.http.FixedClock; 4 import java.io.IOException; 5 import java.net.URI; 6 import java.util.Map; 7 8 public class GdchCredentialsTestUtil { registerGdchCredentialWithMockTransport( GdchCredentials credentials, MockTokenServerTransport transport, String projectId, String serviceIdentityName, String tokenString, URI tokenServerUri)9 public static void registerGdchCredentialWithMockTransport( 10 GdchCredentials credentials, 11 MockTokenServerTransport transport, 12 String projectId, 13 String serviceIdentityName, 14 String tokenString, 15 URI tokenServerUri) { 16 credentials.clock = new FixedClock(0L); 17 transport.addGdchServiceAccount( 18 GdchCredentials.getIssuerSubjectValue(projectId, serviceIdentityName), tokenString); 19 transport.setTokenServerUri(tokenServerUri); 20 } 21 fromJson( Map<String, Object> json, MockTokenServerTransportFactory transportFactory)22 public static GdchCredentials fromJson( 23 Map<String, Object> json, MockTokenServerTransportFactory transportFactory) 24 throws IOException { 25 return GdchCredentials.fromJson(json, transportFactory); 26 } 27 } 28