Update based on code review feedback
This commit is contained in:
parent
0cb1447797
commit
e31ff3c59a
|
@ -8,7 +8,7 @@ import com.amazonaws.services.dynamodbv2.model.ResourceInUseException;
|
||||||
import com.baeldung.Application;
|
import com.baeldung.Application;
|
||||||
import com.baeldung.spring.data.dynamodb.model.ProductInfo;
|
import com.baeldung.spring.data.dynamodb.model.ProductInfo;
|
||||||
import com.baeldung.spring.data.dynamodb.repositories.ProductInfoRepository;
|
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.Before;
|
||||||
import org.junit.ClassRule;
|
import org.junit.ClassRule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -35,7 +35,7 @@ import static org.junit.Assert.assertThat;
|
||||||
public class ProductInfoRepositoryIntegrationTest {
|
public class ProductInfoRepositoryIntegrationTest {
|
||||||
|
|
||||||
@ClassRule
|
@ClassRule
|
||||||
public static LocalDynamoDBCreationRule dynamoDB = new LocalDynamoDBCreationRule();
|
public static LocalDbCreationRule dynamoDB = new LocalDbCreationRule();
|
||||||
|
|
||||||
private DynamoDBMapper dynamoDBMapper;
|
private DynamoDBMapper dynamoDBMapper;
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,11 @@ import org.junit.rules.ExternalResource;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
public class LocalDynamoDBCreationRule extends ExternalResource {
|
public class LocalDbCreationRule extends ExternalResource {
|
||||||
|
|
||||||
protected DynamoDBProxyServer server;
|
protected DynamoDBProxyServer server;
|
||||||
|
|
||||||
public LocalDynamoDBCreationRule() {
|
public LocalDbCreationRule() {
|
||||||
System.setProperty("sqlite4java.library.path", "native-libs");
|
System.setProperty("sqlite4java.library.path", "native-libs");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ public class LocalDynamoDBCreationRule extends ExternalResource {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void after() {
|
protected void after() {
|
||||||
Optional.ofNullable(server).ifPresent(this::stopUnchecked);
|
this.stopUnchecked(server);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void stopUnchecked(DynamoDBProxyServer dynamoDbServer) {
|
protected void stopUnchecked(DynamoDBProxyServer dynamoDbServer) {
|
Loading…
Reference in New Issue