updates new providers in TestS3AAWSCredentialsProvider to V2
This commit is contained in:
parent
0338fd89f6
commit
644a32f9d2
|
@ -34,6 +34,7 @@ import javax.annotation.Nullable;
|
||||||
|
|
||||||
import com.amazonaws.auth.AWSCredentials;
|
import com.amazonaws.auth.AWSCredentials;
|
||||||
import com.amazonaws.auth.AWSCredentialsProvider;
|
import com.amazonaws.auth.AWSCredentialsProvider;
|
||||||
|
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
|
||||||
import software.amazon.awssdk.auth.credentials.AwsCredentials;
|
import software.amazon.awssdk.auth.credentials.AwsCredentials;
|
||||||
import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
|
import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
|
||||||
import software.amazon.awssdk.auth.credentials.EnvironmentVariableCredentialsProvider;
|
import software.amazon.awssdk.auth.credentials.EnvironmentVariableCredentialsProvider;
|
||||||
|
@ -482,17 +483,8 @@ public class TestS3AAWSCredentialsProvider {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final AWSCredentials EXPECTED_CREDENTIALS = new AWSCredentials() {
|
private static final AwsCredentials EXPECTED_CREDENTIALS =
|
||||||
@Override
|
AwsBasicCredentials.create("expectedAccessKey", "expectedSecret");
|
||||||
public String getAWSAccessKeyId() {
|
|
||||||
return "expectedAccessKey";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getAWSSecretKey() {
|
|
||||||
return "expectedSecret";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Credential provider that takes a long time.
|
* Credential provider that takes a long time.
|
||||||
|
@ -504,7 +496,7 @@ public class TestS3AAWSCredentialsProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected AWSCredentials createCredentials(Configuration config) throws IOException {
|
protected AwsCredentials createCredentials(Configuration config) throws IOException {
|
||||||
// yield to other callers to induce race condition
|
// yield to other callers to induce race condition
|
||||||
Thread.yield();
|
Thread.yield();
|
||||||
return EXPECTED_CREDENTIALS;
|
return EXPECTED_CREDENTIALS;
|
||||||
|
@ -578,7 +570,7 @@ public class TestS3AAWSCredentialsProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected AWSCredentials createCredentials(Configuration config) throws IOException {
|
protected AwsCredentials createCredentials(Configuration config) throws IOException {
|
||||||
throw new IOException("expected error");
|
throw new IOException("expected error");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue