Merge pull request #3694 from knightdna/BAEL-681-2

BAEL-681 (2)
This commit is contained in:
Carsten Gräf 2018-02-19 19:11:51 +01:00 committed by GitHub
commit a4d682e57b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -26,7 +26,7 @@
<sqlite4java.version>1.0.392</sqlite4java.version>
<dynamodb.version>1.11.106</dynamodb.version>
<dynamodblocal.version>1.11.86</dynamodblocal.version>
<dynamodblocal.repository.url>https://s3.eu-central-1.amazonaws.com/dynamodb-local-frankfurt/release</dynamodblocal.repository.url>
<dynamodblocal.repository.url>https://s3-us-west-2.amazonaws.com/dynamodb-local/release</dynamodblocal.repository.url>
</properties>
<dependencyManagement>

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