diff --git a/java/statestore/src/test/java/sleeper/statestore/dynamodb/DynamoDBStateStoreIT.java b/java/statestore/src/test/java/sleeper/statestore/dynamodb/DynamoDBStateStoreIT.java index 40788c3133..23b700c538 100644 --- a/java/statestore/src/test/java/sleeper/statestore/dynamodb/DynamoDBStateStoreIT.java +++ b/java/statestore/src/test/java/sleeper/statestore/dynamodb/DynamoDBStateStoreIT.java @@ -21,13 +21,11 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.testcontainers.containers.GenericContainer; import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; import sleeper.configuration.properties.instance.InstanceProperties; import sleeper.configuration.properties.table.TableProperties; -import sleeper.core.CommonTestConstants; import sleeper.core.key.Key; import sleeper.core.partition.Partition; import sleeper.core.partition.PartitionTree; @@ -48,6 +46,7 @@ import sleeper.core.statestore.FileInfoFactory; import sleeper.core.statestore.StateStore; import sleeper.core.statestore.StateStoreException; +import sleeper.dynamodb.tools.DynamoDBContainer; import java.time.Instant; import java.util.ArrayList; @@ -62,26 +61,24 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static sleeper.core.schema.SchemaTestHelper.schemaWithKey; import static sleeper.configuration.properties.InstancePropertiesTestHelper.createTestInstanceProperties; import static sleeper.configuration.properties.table.TablePropertiesTestHelper.createTestTableProperties; import static sleeper.configuration.properties.table.TableProperty.GARBAGE_COLLECTOR_DELAY_BEFORE_DELETION; +import static sleeper.core.schema.SchemaTestHelper.schemaWithKey; import static sleeper.dynamodb.tools.GenericContainerAwsV1ClientHelper.buildAwsV1Client; @Testcontainers public class DynamoDBStateStoreIT { - private static final int DYNAMO_PORT = 8000; private static AmazonDynamoDB dynamoDBClient; @Container - public static GenericContainer dynamoDb = new GenericContainer(CommonTestConstants.DYNAMODB_LOCAL_CONTAINER) - .withExposedPorts(DYNAMO_PORT); + public static DynamoDBContainer dynamoDb = new DynamoDBContainer(); private final InstanceProperties instanceProperties = createTestInstanceProperties(); @BeforeAll public static void initDynamoClient() { - dynamoDBClient = buildAwsV1Client(dynamoDb, DYNAMO_PORT, AmazonDynamoDBClientBuilder.standard()); + dynamoDBClient = buildAwsV1Client(dynamoDb, dynamoDb.getDynamoPort(), AmazonDynamoDBClientBuilder.standard()); } @AfterAll