Update based on code review feedback

This commit is contained in:
Diaz Novandi 2018-02-19 07:03:28 +01:00
parent 0cb1447797
commit e31ff3c59a
2 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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) {