### Question:
ConfigurationAwsCredentialsProvider implements AWSCredentialsProvider { @Override public AWSCredentials getCredentials() { return new BasicAWSCredentials(secret(AWS_ACCESS_KEY), secret(AWS_SECRET_KEY)); } ConfigurationAwsCredentialsProvider(Configuration conf); @Override AWSCredentials getCredentials(); @Override void refresh();  }### Answer:
@Test public void credentialsFallbackToPlainTextConfig() { conf.set(CredentialProvider.CLEAR_TEXT_FALLBACK, TRUE.toString()); conf.set(AWS_ACCESS_KEY.key(), "aws_access_key"); conf.set("aws_access_key", "access"); conf.set(AWS_SECRET_KEY.key(), "aws_secret_key"); conf.set("aws_secret_key", "secret"); ConfigurationAwsCredentialsProvider provider = new ConfigurationAwsCredentialsProvider(conf); AWSCredentials creds = provider.getCredentials(); assertThat(creds.getAWSAccessKeyId()).isEqualTo("access"); assertThat(creds.getAWSSecretKey()).isEqualTo("secret"); }
@Test(expected = RuntimeException.class) public void credentialsCannotBeRead() throws Exception { conf.set(AWS_ACCESS_KEY.key(), "aws_access_key"); conf.set(AWS_SECRET_KEY.key(), "aws_secret_key"); when(conf.getPassword("aws_access_key")).thenThrow(IOException.class); new ConfigurationAwsCredentialsProvider(conf).getCredentials(); }
@Test(expected = RuntimeException.class) public void credentialsFailure() { new ConfigurationAwsCredentialsProvider(conf).getCredentials(); }