use of org.apache.druid.common.aws.FileSessionCredentialsProvider in project druid by druid-io.
the class TestFileSessionCredentialsProvider method test.
@Test
public void test() throws IOException {
File file = folder.newFile();
try (BufferedWriter out = Files.newWriter(file, StandardCharsets.UTF_8)) {
out.write("sessionToken=sessionTokenSample\nsecretKey=secretKeySample\naccessKey=accessKeySample\n");
}
FileSessionCredentialsProvider provider = new FileSessionCredentialsProvider(file.getAbsolutePath());
AWSSessionCredentials sessionCredentials = (AWSSessionCredentials) provider.getCredentials();
Assert.assertEquals("sessionTokenSample", sessionCredentials.getSessionToken());
Assert.assertEquals("accessKeySample", sessionCredentials.getAWSAccessKeyId());
Assert.assertEquals("secretKeySample", sessionCredentials.getAWSSecretKey());
}
Aggregations