From e31ff3c59acb367bc613fb76fae7f6ea5c50e824 Mon Sep 17 00:00:00 2001 From: Diaz Novandi Date: Mon, 19 Feb 2018 07:03:28 +0100 Subject: [PATCH 1/2] Update based on code review feedback --- .../repository/ProductInfoRepositoryIntegrationTest.java | 4 ++-- ...alDynamoDBCreationRule.java => LocalDbCreationRule.java} | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) rename persistence-modules/spring-data-dynamodb/src/test/java/com/baeldung/spring/data/dynamodb/repository/rule/{LocalDynamoDBCreationRule.java => LocalDbCreationRule.java} (83%) diff --git a/persistence-modules/spring-data-dynamodb/src/test/java/com/baeldung/spring/data/dynamodb/repository/ProductInfoRepositoryIntegrationTest.java b/persistence-modules/spring-data-dynamodb/src/test/java/com/baeldung/spring/data/dynamodb/repository/ProductInfoRepositoryIntegrationTest.java index 8052aba3df..6cbd5b0a5a 100644 --- a/persistence-modules/spring-data-dynamodb/src/test/java/com/baeldung/spring/data/dynamodb/repository/ProductInfoRepositoryIntegrationTest.java +++ b/persistence-modules/spring-data-dynamodb/src/test/java/com/baeldung/spring/data/dynamodb/repository/ProductInfoRepositoryIntegrationTest.java @@ -8,7 +8,7 @@ import com.amazonaws.services.dynamodbv2.model.ResourceInUseException; import com.baeldung.Application; import com.baeldung.spring.data.dynamodb.model.ProductInfo; import com.baeldung.spring.data.dynamodb.repositories.ProductInfoRepository; -import com.baeldung.spring.data.dynamodb.repository.rule.LocalDynamoDBCreationRule; +import com.baeldung.spring.data.dynamodb.repository.rule.LocalDbCreationRule; import org.junit.Before; import org.junit.ClassRule; import org.junit.Test; @@ -35,7 +35,7 @@ import static org.junit.Assert.assertThat; public class ProductInfoRepositoryIntegrationTest { @ClassRule - public static LocalDynamoDBCreationRule dynamoDB = new LocalDynamoDBCreationRule(); + public static LocalDbCreationRule dynamoDB = new LocalDbCreationRule(); private DynamoDBMapper dynamoDBMapper; diff --git a/persistence-modules/spring-data-dynamodb/src/test/java/com/baeldung/spring/data/dynamodb/repository/rule/LocalDynamoDBCreationRule.java b/persistence-modules/spring-data-dynamodb/src/test/java/com/baeldung/spring/data/dynamodb/repository/rule/LocalDbCreationRule.java similarity index 83% rename from persistence-modules/spring-data-dynamodb/src/test/java/com/baeldung/spring/data/dynamodb/repository/rule/LocalDynamoDBCreationRule.java rename to persistence-modules/spring-data-dynamodb/src/test/java/com/baeldung/spring/data/dynamodb/repository/rule/LocalDbCreationRule.java index 62334b6d00..555d558b06 100644 --- a/persistence-modules/spring-data-dynamodb/src/test/java/com/baeldung/spring/data/dynamodb/repository/rule/LocalDynamoDBCreationRule.java +++ b/persistence-modules/spring-data-dynamodb/src/test/java/com/baeldung/spring/data/dynamodb/repository/rule/LocalDbCreationRule.java @@ -6,11 +6,11 @@ import org.junit.rules.ExternalResource; import java.util.Optional; -public class LocalDynamoDBCreationRule extends ExternalResource { +public class LocalDbCreationRule extends ExternalResource { protected DynamoDBProxyServer server; - public LocalDynamoDBCreationRule() { + public LocalDbCreationRule() { System.setProperty("sqlite4java.library.path", "native-libs"); } @@ -23,7 +23,7 @@ public class LocalDynamoDBCreationRule extends ExternalResource { @Override protected void after() { - Optional.ofNullable(server).ifPresent(this::stopUnchecked); + this.stopUnchecked(server); } protected void stopUnchecked(DynamoDBProxyServer dynamoDbServer) { From 22b047f98bfcce37e39a9ff425c3c801f48e30c1 Mon Sep 17 00:00:00 2001 From: Diaz Novandi Date: Mon, 19 Feb 2018 07:04:49 +0100 Subject: [PATCH 2/2] Use DynamoDB repo server in the US --- persistence-modules/spring-data-dynamodb/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/persistence-modules/spring-data-dynamodb/pom.xml b/persistence-modules/spring-data-dynamodb/pom.xml index 0b78aac10e..c3ea9abf08 100644 --- a/persistence-modules/spring-data-dynamodb/pom.xml +++ b/persistence-modules/spring-data-dynamodb/pom.xml @@ -26,7 +26,7 @@ 1.0.392 1.11.106 1.11.86 - https://s3.eu-central-1.amazonaws.com/dynamodb-local-frankfurt/release + https://s3-us-west-2.amazonaws.com/dynamodb-local/release