23
23
import org .junit .BeforeClass ;
24
24
import org .junit .Test ;
25
25
import software .amazon .awssdk .auth .credentials .AwsBasicCredentials ;
26
+ import software .amazon .awssdk .auth .credentials .AwsCredentialsProvider ;
26
27
import software .amazon .awssdk .auth .credentials .StaticCredentialsProvider ;
27
28
import software .amazon .awssdk .regions .Region ;
28
29
import software .amazon .awssdk .services .s3 .model .GetUrlRequest ;
@@ -49,13 +50,13 @@ public class S3UtilitiesTest {
49
50
@ BeforeClass
50
51
public static void setup () {
51
52
defaultClient = S3Client .builder ()
52
- .credentialsProvider (StaticCredentialsProvider . create ( AwsBasicCredentials . create ( "akid" , "skid" ) ))
53
+ .credentialsProvider (dummyCreds ( ))
53
54
.region (Region .US_WEST_2 )
54
55
.build ();
55
56
defaultUtilities = defaultClient .utilities ();
56
57
57
58
asyncClient = S3AsyncClient .builder ()
58
- .credentialsProvider (StaticCredentialsProvider . create ( AwsBasicCredentials . create ( "akid" , "skid" ) ))
59
+ .credentialsProvider (dummyCreds ( ))
59
60
.region (Region .AP_NORTHEAST_2 )
60
61
.build ();
61
62
utilitiesFromAsyncClient = asyncClient .utilities ();
@@ -131,6 +132,8 @@ public void test_EndpointOnRequestTakesPrecendence() throws MalformedURLExceptio
131
132
@ Test
132
133
public void testWithAccelerateAndDualStackEnabled () throws MalformedURLException {
133
134
S3Utilities utilities = S3Client .builder ()
135
+ .credentialsProvider (dummyCreds ())
136
+ .region (Region .US_WEST_2 )
134
137
.serviceConfiguration (ACCELERATE_AND_DUALSTACK_ENABLED )
135
138
.build ()
136
139
.utilities ();
@@ -169,4 +172,8 @@ private static GetUrlRequest requestWithSpecialCharacters() {
169
172
.key ("key with@spaces" )
170
173
.build ();
171
174
}
175
+
176
+ private static AwsCredentialsProvider dummyCreds () {
177
+ return StaticCredentialsProvider .create (AwsBasicCredentials .create ("akid" , "skid" ));
178
+ }
172
179
}
0 commit comments