### Question:
AwsAuthConfigProperties { static Properties forAwsCredentials(AwsCredentials awsCredentials) { final Properties properties = new Properties(); if (awsCredentials.isDefault()) { properties.setProperty( AWSConfigConstants.AWS_CREDENTIALS_PROVIDER, AWSConfigConstants.CredentialProvider.AUTO.name()); } else if (awsCredentials.isBasic()) { properties.setProperty( AWSConfigConstants.AWS_CREDENTIALS_PROVIDER, AWSConfigConstants.CredentialProvider.BASIC.name()); final AwsCredentials.BasicAwsCredentials basicCredentials = awsCredentials.asBasic(); properties.setProperty( AWSConfigConstants.accessKeyId(AWSConfigConstants.AWS_CREDENTIALS_PROVIDER), basicCredentials.accessKeyId()); properties.setProperty( AWSConfigConstants.secretKey(AWSConfigConstants.AWS_CREDENTIALS_PROVIDER), basicCredentials.secretAccessKey()); } else if (awsCredentials.isProfile()) { properties.setProperty( AWSConfigConstants.AWS_CREDENTIALS_PROVIDER, AWSConfigConstants.CredentialProvider.PROFILE.name()); final AwsCredentials.ProfileAwsCredentials profileCredentials = awsCredentials.asProfile(); properties.setProperty( AWSConfigConstants.profileName(AWSConfigConstants.AWS_CREDENTIALS_PROVIDER), profileCredentials.name()); profileCredentials .path() .ifPresent( path -> properties.setProperty( AWSConfigConstants.profilePath(AWSConfigConstants.AWS_CREDENTIALS_PROVIDER), path)); } else { throw new IllegalStateException( "Unrecognized AWS credentials configuration type: " + awsCredentials); } return properties; } private  AwsAuthConfigProperties();   }### Answer:
@Test public void awsDefaultCredentialsProperties() { final Properties properties = AwsAuthConfigProperties.forAwsCredentials(AwsCredentials.fromDefaultProviderChain()); assertThat(properties.entrySet(), hasSize(1)); assertThat( properties, hasEntry( AWSConfigConstants.AWS_CREDENTIALS_PROVIDER, AWSConfigConstants.CredentialProvider.AUTO.name())); }
@Test public void awsBasicCredentialsProperties() { final Properties properties = AwsAuthConfigProperties.forAwsCredentials( AwsCredentials.basic("fake-access-key-id", "fake-secret-access-key")); assertThat(properties.entrySet(), hasSize(3)); assertThat( properties, hasEntry( AWSConfigConstants.AWS_CREDENTIALS_PROVIDER, AWSConfigConstants.CredentialProvider.BASIC.name())); assertThat( properties, hasEntry( AWSConfigConstants.accessKeyId(AWSConfigConstants.AWS_CREDENTIALS_PROVIDER), "fake-access-key-id")); assertThat( properties, hasEntry( AWSConfigConstants.secretKey(AWSConfigConstants.AWS_CREDENTIALS_PROVIDER), "fake-secret-access-key")); }
@Test public void awsProfileCredentialsProperties() { final Properties properties = AwsAuthConfigProperties.forAwsCredentials( AwsCredentials.profile("fake-profile", "/fake/profile/path")); assertThat(properties.entrySet(), hasSize(3)); assertThat( properties, hasEntry( AWSConfigConstants.AWS_CREDENTIALS_PROVIDER, AWSConfigConstants.CredentialProvider.PROFILE.name())); assertThat( properties, hasEntry( AWSConfigConstants.profileName(AWSConfigConstants.AWS_CREDENTIALS_PROVIDER), "fake-profile")); assertThat( properties, hasEntry( AWSConfigConstants.profilePath(AWSConfigConstants.AWS_CREDENTIALS_PROVIDER), "/fake/profile/path")); }