From e31ff3c59acb367bc613fb76fae7f6ea5c50e824 Mon Sep 17 00:00:00 2001 From: Diaz Novandi Date: Mon, 19 Feb 2018 07:03:28 +0100 Subject: [PATCH] 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) {