@Test public void requestCredentialsInRequestConfig_TakesPrecedenceOverClientCredentials() { AWSCredentialsProvider requestCredentials = mock(AWSCredentialsProvider.class); RequestConfig requestConfig = mock(RequestConfig.class); when(requestConfig.getCredentialsProvider()).thenReturn(requestCredentials); AWSCredentialsProvider actual = CredentialUtils .getCredentialsProvider(requestConfig, CLIENT_CREDENTIALS); assertEquals(requestCredentials, actual); }
public static AWSCredentialsProvider getCredentialsProvider( AmazonWebServiceRequest req, AWSCredentialsProvider base) { if (req != null && req.getRequestCredentialsProvider() != null) { return req.getRequestCredentialsProvider(); } return base; }
CredentialUtils { public static AWSCredentialsProvider getCredentialsProvider( AmazonWebServiceRequest req, AWSCredentialsProvider base) { if (req != null && req.getRequestCredentialsProvider() != null) { return req.getRequestCredentialsProvider(); } return base; } }
CredentialUtils { public static AWSCredentialsProvider getCredentialsProvider( AmazonWebServiceRequest req, AWSCredentialsProvider base) { if (req != null && req.getRequestCredentialsProvider() != null) { return req.getRequestCredentialsProvider(); } return base; }  }
CredentialUtils { public static AWSCredentialsProvider getCredentialsProvider( AmazonWebServiceRequest req, AWSCredentialsProvider base) { if (req != null && req.getRequestCredentialsProvider() != null) { return req.getRequestCredentialsProvider(); } return base; }  static AWSCredentialsProvider getCredentialsProvider(
            AmazonWebServiceRequest req,
            AWSCredentialsProvider base); static AWSCredentialsProvider getCredentialsProvider(
            RequestConfig requestConfig,
            AWSCredentialsProvider base); }
CredentialUtils { public static AWSCredentialsProvider getCredentialsProvider( AmazonWebServiceRequest req, AWSCredentialsProvider base) { if (req != null && req.getRequestCredentialsProvider() != null) { return req.getRequestCredentialsProvider(); } return base; }  static AWSCredentialsProvider getCredentialsProvider(
            AmazonWebServiceRequest req,
            AWSCredentialsProvider base); static AWSCredentialsProvider getCredentialsProvider(
            RequestConfig requestConfig,
            AWSCredentialsProvider base);  }