@@ -56,42 +56,40 @@ static void startContainer() {
5656 }
5757
5858 static DynamoDbAsyncClient dynamoDbClient () {
59- return applyAwsClientOptions (DynamoDbAsyncClient .builder (), LocalStackContainer . Service . DYNAMODB );
59+ return applyAwsClientOptions (DynamoDbAsyncClient .builder ());
6060 }
6161
6262 static KinesisAsyncClient kinesisClient () {
63- return applyAwsClientOptions (KinesisAsyncClient .builder (), LocalStackContainer . Service . KINESIS );
63+ return applyAwsClientOptions (KinesisAsyncClient .builder ());
6464 }
6565
6666 static CloudWatchAsyncClient cloudWatchClient () {
67- return applyAwsClientOptions (CloudWatchAsyncClient .builder (), LocalStackContainer . Service . CLOUDWATCH );
67+ return applyAwsClientOptions (CloudWatchAsyncClient .builder ());
6868 }
6969
7070 static S3AsyncClient s3AsyncClient () {
71- return applyAwsClientOptions (S3AsyncClient .builder (), LocalStackContainer . Service . S3 );
71+ return applyAwsClientOptions (S3AsyncClient .builder ());
7272 }
7373
7474 static S3Client s3Client () {
75- return applyAwsClientOptions (S3Client .builder ().httpClient (ApacheHttpClient .create ()),
76- LocalStackContainer .Service .S3 );
75+ return applyAwsClientOptions (S3Client .builder ().httpClient (ApacheHttpClient .create ()));
7776 }
7877
7978 static SqsAsyncClient sqsClient () {
80- return applyAwsClientOptions (SqsAsyncClient .builder (), LocalStackContainer . Service . SQS );
79+ return applyAwsClientOptions (SqsAsyncClient .builder ());
8180 }
8281
8382 static AwsCredentialsProvider credentialsProvider () {
8483 return StaticCredentialsProvider .create (
8584 AwsBasicCredentials .create (LOCAL_STACK_CONTAINER .getAccessKey (), LOCAL_STACK_CONTAINER .getSecretKey ()));
8685 }
8786
88- private static <B extends AwsClientBuilder <B , T >, T > T applyAwsClientOptions (B clientBuilder ,
89- LocalStackContainer .Service serviceToBuild ) {
90-
87+ private static <B extends AwsClientBuilder <B , T >, T > T applyAwsClientOptions (B clientBuilder ) {
9188 return clientBuilder
9289 .region (Region .of (LOCAL_STACK_CONTAINER .getRegion ()))
9390 .credentialsProvider (credentialsProvider ())
94- .endpointOverride (LOCAL_STACK_CONTAINER .getEndpointOverride ( serviceToBuild ))
91+ .endpointOverride (LOCAL_STACK_CONTAINER .getEndpoint ( ))
9592 .build ();
9693 }
94+
9795}
0 commit comments