@Test public void testImplicitApplicationDefaultCredentials() throws Exception { final TestRunner runner = TestRunners.newTestRunner(MockCredentialsFactoryProcessor.class); runner.assertValid(); Map<PropertyDescriptor, String> properties = runner.getProcessContext().getProperties(); final CredentialsFactory factory = new CredentialsFactory(); final GoogleCredentials credentials = factory.getGoogleCredentials(properties); assertNotNull(credentials); }
public GoogleCredentials getGoogleCredentials(final Map<PropertyDescriptor, String> properties) throws IOException { final CredentialsStrategy primaryStrategy = selectPrimaryStrategy(properties); return primaryStrategy.getGoogleCredentials(properties); }
CredentialsFactory { public GoogleCredentials getGoogleCredentials(final Map<PropertyDescriptor, String> properties) throws IOException { final CredentialsStrategy primaryStrategy = selectPrimaryStrategy(properties); return primaryStrategy.getGoogleCredentials(properties); } }
CredentialsFactory { public GoogleCredentials getGoogleCredentials(final Map<PropertyDescriptor, String> properties) throws IOException { final CredentialsStrategy primaryStrategy = selectPrimaryStrategy(properties); return primaryStrategy.getGoogleCredentials(properties); } CredentialsFactory(); }
CredentialsFactory { public GoogleCredentials getGoogleCredentials(final Map<PropertyDescriptor, String> properties) throws IOException { final CredentialsStrategy primaryStrategy = selectPrimaryStrategy(properties); return primaryStrategy.getGoogleCredentials(properties); } CredentialsFactory(); CredentialsStrategy selectPrimaryStrategy(final Map<PropertyDescriptor, String> properties); CredentialsStrategy selectPrimaryStrategy(final ValidationContext validationContext); Collection<ValidationResult> validate(final ValidationContext validationContext); GoogleCredentials getGoogleCredentials(final Map<PropertyDescriptor, String> properties); }
CredentialsFactory { public GoogleCredentials getGoogleCredentials(final Map<PropertyDescriptor, String> properties) throws IOException { final CredentialsStrategy primaryStrategy = selectPrimaryStrategy(properties); return primaryStrategy.getGoogleCredentials(properties); } CredentialsFactory(); CredentialsStrategy selectPrimaryStrategy(final Map<PropertyDescriptor, String> properties); CredentialsStrategy selectPrimaryStrategy(final ValidationContext validationContext); Collection<ValidationResult> validate(final ValidationContext validationContext); GoogleCredentials getGoogleCredentials(final Map<PropertyDescriptor, String> properties);  }