summaryrefslogtreecommitdiffstats
path: root/vespa-athenz/src/test/java/com
diff options
context:
space:
mode:
authorMorten Tokle <mortent@verizonmedia.com>2019-09-09 15:22:02 +0200
committerMorten Tokle <mortent@verizonmedia.com>2019-09-09 15:22:02 +0200
commita72405c2548d45f91a2ecfc5a035acefa3619f52 (patch)
treef3894498fee8740d5ac28afda62723ab1ff8fd4e /vespa-athenz/src/test/java/com
parentdd25c2a3c4c16ba96eda61e996f5347f1f8eaa9c (diff)
Remove unused credentials provider
Diffstat (limited to 'vespa-athenz/src/test/java/com')
-rw-r--r--vespa-athenz/src/test/java/com/yahoo/vespa/athenz/client/aws/AwsCredentialProviderTest.java35
1 files changed, 0 insertions, 35 deletions
diff --git a/vespa-athenz/src/test/java/com/yahoo/vespa/athenz/client/aws/AwsCredentialProviderTest.java b/vespa-athenz/src/test/java/com/yahoo/vespa/athenz/client/aws/AwsCredentialProviderTest.java
deleted file mode 100644
index d637dcae14c..00000000000
--- a/vespa-athenz/src/test/java/com/yahoo/vespa/athenz/client/aws/AwsCredentialProviderTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.athenz.client.aws;
-
-import com.yahoo.vespa.athenz.api.AwsTemporaryCredentials;
-import org.junit.Test;
-
-import java.time.Clock;
-import java.time.Duration;
-import java.time.Instant;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-public class AwsCredentialProviderTest {
-
- @Test
- public void refreshes_correctly() {
- Clock clock = Clock.systemUTC();
- // Does not require refresh when expires in 10 minutes
- assertFalse(AwsCredentialsProvider.shouldRefresh(getCredentials(clock.instant().plus(Duration.ofMinutes(10)))));
-
- // Requires refresh when expires in 3 minutes
- assertTrue(AwsCredentialsProvider.shouldRefresh(getCredentials(clock.instant().plus(Duration.ofMinutes(3)))));
-
- // Requires refresh when expired
- assertTrue(AwsCredentialsProvider.shouldRefresh(getCredentials(clock.instant().minus(Duration.ofMinutes(1)))));
-
- // Refreshes when no credentials provided
- assertTrue(AwsCredentialsProvider.shouldRefresh(null));
- }
-
- private AwsTemporaryCredentials getCredentials(Instant expiration) {
- return new AwsTemporaryCredentials("accesskey", "secretaccesskey", "sessionToken", expiration);
- }
-}