KinesisAWSCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { return creds; } KinesisAWSCredentialsProvider(String accessKey, String secretKey); @Override AWSCredentials getCredentials(); @Override void refresh();  }
@Test public void testCredentialsProviderWithNonNullKeys() { String accessKey = "accessKey"; String secretKey = "secretKey"; KinesisAWSCredentialsProvider credProvider = new KinesisAWSCredentialsProvider(accessKey, secretKey); assertEquals(credProvider.getCredentials().getAWSAccessKeyId(), accessKey); assertEquals(credProvider.getCredentials().getAWSSecretKey(), secretKey); }
@Test public void testCredentialsProviderWithNullAccessKey() { String secretKey = "secretKey"; KinesisAWSCredentialsProvider credProvider = new KinesisAWSCredentialsProvider(null, secretKey); assertNull(credProvider.getCredentials().getAWSAccessKeyId()); assertNull(credProvider.getCredentials().getAWSSecretKey()); }
@Test public void testCredentialsProviderWithNullSecretKey() { String accessKey = "accessKey"; KinesisAWSCredentialsProvider credProvider = new KinesisAWSCredentialsProvider(accessKey, null); assertNull(credProvider.getCredentials().getAWSAccessKeyId()); assertNull(credProvider.getCredentials().getAWSSecretKey()); }
@Test public void testCredentialsProviderWithNullKeys() { KinesisAWSCredentialsProvider credProvider = new KinesisAWSCredentialsProvider(null, null); assertNull(credProvider.getCredentials().getAWSAccessKeyId()); assertNull(credProvider.getCredentials().getAWSSecretKey()); }