Skip to content

Commit

Permalink
implement code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli authored Dec 16, 2024
1 parent 667e1c0 commit def1125
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

import static org.testcontainers.containers.localstack.LocalStackContainer.Service.KINESIS;

import java.time.Duration;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.test.context.DynamicPropertyRegistrar;
import org.testcontainers.containers.localstack.LocalStackContainer;
import org.testcontainers.utility.DockerImageName;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
import software.amazon.awssdk.core.retry.RetryPolicy;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.kinesis.KinesisAsyncClient;

Expand All @@ -22,7 +25,8 @@ public class ContainerConfig {
@Bean
LocalStackContainer localStackContainer() {
return new LocalStackContainer(
DockerImageName.parse("localstack/localstack").withTag("4.0.3"));
DockerImageName.parse("localstack/localstack").withTag("4.0.3"))
.withServices(KINESIS);
}

@Bean
Expand All @@ -49,6 +53,11 @@ KinesisAsyncClient amazonKinesis(LocalStackContainer localStackContainer) {
AwsBasicCredentials.create(
localStackContainer.getAccessKey(),
localStackContainer.getSecretKey())))
.overrideConfiguration(
ClientOverrideConfiguration.builder()
.apiCallTimeout(Duration.ofSeconds(10))
.retryPolicy(RetryPolicy.builder().numRetries(3).build())
.build())
.build();
}
}

0 comments on commit def1125

Please sign in to comment.