Skip to content

Commit 54b60ab

Browse files
committed
adding tests dependencies
Signed-off-by: Breno Pessoa <[email protected]>
1 parent 1776efb commit 54b60ab

File tree

2 files changed

+64
-19
lines changed

2 files changed

+64
-19
lines changed

dynamodb-driver/pom.xml

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,31 +56,46 @@
5656
<organizationUrl>https://dev.eclipse.org/mailman/listinfo/jnosql-dev</organizationUrl>
5757
</developer>
5858
</developers>
59-
59+
6060
<properties>
61-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
62-
</properties>
63-
<dependencies>
64-
<dependency>
65-
<groupId>org.jnosql.diana</groupId>
66-
<artifactId>diana-key-value</artifactId>
67-
<version>${project.version}</version>
68-
</dependency>
69-
<dependency>
70-
<groupId>org.jnosql.diana</groupId>
71-
<artifactId>diana-driver-commons</artifactId>
72-
<version>${project.version}</version>
73-
</dependency>
74-
<dependency>
61+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
62+
</properties>
63+
<dependencies>
64+
<dependency>
65+
<groupId>org.jnosql.diana</groupId>
66+
<artifactId>diana-key-value</artifactId>
67+
<version>${project.version}</version>
68+
</dependency>
69+
<dependency>
70+
<groupId>org.jnosql.diana</groupId>
71+
<artifactId>diana-driver-commons</artifactId>
72+
<version>${project.version}</version>
73+
</dependency>
74+
<dependency>
7575
<groupId>software.amazon.awssdk</groupId>
7676
<artifactId>dynamodb</artifactId>
77-
<version>2.0.0-preview-11</version>
77+
<version>2.0.0-preview-12</version>
7878
</dependency>
7979
<dependency>
8080
<groupId>software.amazon.awssdk</groupId>
8181
<artifactId>apache-client</artifactId>
82-
<version>2.0.0-preview-11</version>
82+
<version>2.0.0-preview-12</version>
8383
</dependency>
84-
</dependencies>
85-
84+
<dependency>
85+
<groupId>software.amazon.awssdk</groupId>
86+
<artifactId>aws-http-client-apache</artifactId>
87+
<version>2.0.0-preview-1</version>
88+
</dependency>
89+
<dependency>
90+
<groupId>software.amazon.awssdk</groupId>
91+
<artifactId>aws-http-nio-client-netty</artifactId>
92+
<version>2.0.0-preview-1</version>
93+
</dependency>
94+
<dependency>
95+
<groupId>org.testcontainers</groupId>
96+
<artifactId>testcontainers</artifactId>
97+
<version>${testcontainers.version}</version>
98+
<scope>test</scope>
99+
</dependency>
100+
</dependencies>
86101
</project>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package org.jnosql.diana.dynamodb;
2+
3+
import org.jnosql.diana.api.key.BucketManagerFactory;
4+
import org.jnosql.diana.dynamodb.key.DynamoDBKeyValueConfiguration;
5+
import org.testcontainers.containers.GenericContainer;
6+
7+
public class DynamoDBTestUtils {
8+
9+
private static GenericContainer dynamodb =
10+
new GenericContainer("amazon/dynamodb-local:latest")
11+
.withExposedPorts(8000)
12+
.withEnv("AWS_ACCESS_KEY_ID", "aws --profile default configure get aws_access_key_id")
13+
.withEnv("AWS_SECRET_ACCESS_KEY", "aws --profile default configure get aws_secret_access_key");
14+
//.withCommand("--rm");
15+
16+
// .waitingFor(Wait.forHttp("/")
17+
// .forStatusCode(200));
18+
19+
20+
public static BucketManagerFactory get() {
21+
dynamodb.start();
22+
DynamoDBKeyValueConfiguration configuration = new DynamoDBKeyValueConfiguration();
23+
configuration.setEndPoint("http://"+dynamodb.getContainerIpAddress()+":"+dynamodb.getFirstMappedPort());
24+
return configuration.get();
25+
}
26+
27+
public static void shutDown() {
28+
dynamodb.close();
29+
}
30+
}

0 commit comments

Comments
 (0)