From 8dd8cab6643dde3c713e4d8e3c1acb3c3269dab3 Mon Sep 17 00:00:00 2001 From: Chris Anatalio Date: Wed, 26 Oct 2016 17:18:23 -0700 Subject: [PATCH 1/2] BAEL-223: Updated package name and project directory --- .../.gitignore | 0 .../README.MD | 0 {spring-boot-data-dynamodb => spring-data-dynamodb}/pom.xml | 0 .../src/main/java/com/baeldung/Application.java | 0 .../spring/data/dynamodb}/config/DynamoDBConfig.java | 4 ++-- .../baeldung/spring/data/dynamodb}/model/ProductInfo.java | 2 +- .../data/dynamodb}/repositories/ProductInfoRepository.java | 4 ++-- .../src/main/resources/application.properties | 0 .../src/main/resources/demo.properties | 0 .../src/main/resources/logback.xml | 0 .../src/main/resources/templates/index.html | 0 .../repository/ProductInfoRepositoryIntegrationTest.java | 6 +++--- .../src/test/resources/application.properties | 0 .../src/test/resources/exception-hibernate.properties | 0 .../src/test/resources/exception.properties | 0 15 files changed, 8 insertions(+), 8 deletions(-) rename {spring-boot-data-dynamodb => spring-data-dynamodb}/.gitignore (100%) rename {spring-boot-data-dynamodb => spring-data-dynamodb}/README.MD (100%) rename {spring-boot-data-dynamodb => spring-data-dynamodb}/pom.xml (100%) rename {spring-boot-data-dynamodb => spring-data-dynamodb}/src/main/java/com/baeldung/Application.java (100%) rename {spring-boot-data-dynamodb/src/main/java/com/baeldung/spring/data/es => spring-data-dynamodb/src/main/java/com/baeldung/spring/data/dynamodb}/config/DynamoDBConfig.java (94%) rename {spring-boot-data-dynamodb/src/main/java/com/baeldung/spring/data/es => spring-data-dynamodb/src/main/java/com/baeldung/spring/data/dynamodb}/model/ProductInfo.java (95%) rename {spring-boot-data-dynamodb/src/main/java/com/baeldung/spring/data/es => spring-data-dynamodb/src/main/java/com/baeldung/spring/data/dynamodb}/repositories/ProductInfoRepository.java (71%) rename {spring-boot-data-dynamodb => spring-data-dynamodb}/src/main/resources/application.properties (100%) rename {spring-boot-data-dynamodb => spring-data-dynamodb}/src/main/resources/demo.properties (100%) rename {spring-boot-data-dynamodb => spring-data-dynamodb}/src/main/resources/logback.xml (100%) rename {spring-boot-data-dynamodb => spring-data-dynamodb}/src/main/resources/templates/index.html (100%) rename {spring-boot-data-dynamodb/src/test/java/com/baeldung/spring/data/es => spring-data-dynamodb/src/test/java/com/baeldung/spring/data/dynamodb}/repository/ProductInfoRepositoryIntegrationTest.java (93%) rename {spring-boot-data-dynamodb => spring-data-dynamodb}/src/test/resources/application.properties (100%) rename {spring-boot-data-dynamodb => spring-data-dynamodb}/src/test/resources/exception-hibernate.properties (100%) rename {spring-boot-data-dynamodb => spring-data-dynamodb}/src/test/resources/exception.properties (100%) diff --git a/spring-boot-data-dynamodb/.gitignore b/spring-data-dynamodb/.gitignore similarity index 100% rename from spring-boot-data-dynamodb/.gitignore rename to spring-data-dynamodb/.gitignore diff --git a/spring-boot-data-dynamodb/README.MD b/spring-data-dynamodb/README.MD similarity index 100% rename from spring-boot-data-dynamodb/README.MD rename to spring-data-dynamodb/README.MD diff --git a/spring-boot-data-dynamodb/pom.xml b/spring-data-dynamodb/pom.xml similarity index 100% rename from spring-boot-data-dynamodb/pom.xml rename to spring-data-dynamodb/pom.xml diff --git a/spring-boot-data-dynamodb/src/main/java/com/baeldung/Application.java b/spring-data-dynamodb/src/main/java/com/baeldung/Application.java similarity index 100% rename from spring-boot-data-dynamodb/src/main/java/com/baeldung/Application.java rename to spring-data-dynamodb/src/main/java/com/baeldung/Application.java diff --git a/spring-boot-data-dynamodb/src/main/java/com/baeldung/spring/data/es/config/DynamoDBConfig.java b/spring-data-dynamodb/src/main/java/com/baeldung/spring/data/dynamodb/config/DynamoDBConfig.java similarity index 94% rename from spring-boot-data-dynamodb/src/main/java/com/baeldung/spring/data/es/config/DynamoDBConfig.java rename to spring-data-dynamodb/src/main/java/com/baeldung/spring/data/dynamodb/config/DynamoDBConfig.java index 4bc8a128bc..271c1e29ab 100644 --- a/spring-boot-data-dynamodb/src/main/java/com/baeldung/spring/data/es/config/DynamoDBConfig.java +++ b/spring-data-dynamodb/src/main/java/com/baeldung/spring/data/dynamodb/config/DynamoDBConfig.java @@ -1,4 +1,4 @@ -package com.baeldung.spring.data.es.config; +package com.baeldung.spring.data.dynamodb.config; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.BasicAWSCredentials; @@ -11,7 +11,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.util.StringUtils; @Configuration -@EnableDynamoDBRepositories(basePackages = "com.baeldung.spring.data.es.repositories") +@EnableDynamoDBRepositories(basePackages = "com.baeldung.spring.data.dynamodb.repositories") public class DynamoDBConfig { @Value("${amazon.dynamodb.endpoint}") diff --git a/spring-boot-data-dynamodb/src/main/java/com/baeldung/spring/data/es/model/ProductInfo.java b/spring-data-dynamodb/src/main/java/com/baeldung/spring/data/dynamodb/model/ProductInfo.java similarity index 95% rename from spring-boot-data-dynamodb/src/main/java/com/baeldung/spring/data/es/model/ProductInfo.java rename to spring-data-dynamodb/src/main/java/com/baeldung/spring/data/dynamodb/model/ProductInfo.java index 3e75c9e6f2..3b9b0628dd 100644 --- a/spring-boot-data-dynamodb/src/main/java/com/baeldung/spring/data/es/model/ProductInfo.java +++ b/spring-data-dynamodb/src/main/java/com/baeldung/spring/data/dynamodb/model/ProductInfo.java @@ -1,4 +1,4 @@ -package com.baeldung.spring.data.es.model; +package com.baeldung.spring.data.dynamodb.model; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAttribute; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAutoGeneratedKey; diff --git a/spring-boot-data-dynamodb/src/main/java/com/baeldung/spring/data/es/repositories/ProductInfoRepository.java b/spring-data-dynamodb/src/main/java/com/baeldung/spring/data/dynamodb/repositories/ProductInfoRepository.java similarity index 71% rename from spring-boot-data-dynamodb/src/main/java/com/baeldung/spring/data/es/repositories/ProductInfoRepository.java rename to spring-data-dynamodb/src/main/java/com/baeldung/spring/data/dynamodb/repositories/ProductInfoRepository.java index c5eee49634..da47f033b6 100644 --- a/spring-boot-data-dynamodb/src/main/java/com/baeldung/spring/data/es/repositories/ProductInfoRepository.java +++ b/spring-data-dynamodb/src/main/java/com/baeldung/spring/data/dynamodb/repositories/ProductInfoRepository.java @@ -1,6 +1,6 @@ -package com.baeldung.spring.data.es.repositories; +package com.baeldung.spring.data.dynamodb.repositories; -import com.baeldung.spring.data.es.model.ProductInfo; +import com.baeldung.spring.data.dynamodb.model.ProductInfo; import org.socialsignin.spring.data.dynamodb.repository.EnableScan; import org.springframework.data.repository.CrudRepository; diff --git a/spring-boot-data-dynamodb/src/main/resources/application.properties b/spring-data-dynamodb/src/main/resources/application.properties similarity index 100% rename from spring-boot-data-dynamodb/src/main/resources/application.properties rename to spring-data-dynamodb/src/main/resources/application.properties diff --git a/spring-boot-data-dynamodb/src/main/resources/demo.properties b/spring-data-dynamodb/src/main/resources/demo.properties similarity index 100% rename from spring-boot-data-dynamodb/src/main/resources/demo.properties rename to spring-data-dynamodb/src/main/resources/demo.properties diff --git a/spring-boot-data-dynamodb/src/main/resources/logback.xml b/spring-data-dynamodb/src/main/resources/logback.xml similarity index 100% rename from spring-boot-data-dynamodb/src/main/resources/logback.xml rename to spring-data-dynamodb/src/main/resources/logback.xml diff --git a/spring-boot-data-dynamodb/src/main/resources/templates/index.html b/spring-data-dynamodb/src/main/resources/templates/index.html similarity index 100% rename from spring-boot-data-dynamodb/src/main/resources/templates/index.html rename to spring-data-dynamodb/src/main/resources/templates/index.html diff --git a/spring-boot-data-dynamodb/src/test/java/com/baeldung/spring/data/es/repository/ProductInfoRepositoryIntegrationTest.java b/spring-data-dynamodb/src/test/java/com/baeldung/spring/data/dynamodb/repository/ProductInfoRepositoryIntegrationTest.java similarity index 93% rename from spring-boot-data-dynamodb/src/test/java/com/baeldung/spring/data/es/repository/ProductInfoRepositoryIntegrationTest.java rename to spring-data-dynamodb/src/test/java/com/baeldung/spring/data/dynamodb/repository/ProductInfoRepositoryIntegrationTest.java index df727cf727..e384f7dff4 100644 --- a/spring-boot-data-dynamodb/src/test/java/com/baeldung/spring/data/es/repository/ProductInfoRepositoryIntegrationTest.java +++ b/spring-data-dynamodb/src/test/java/com/baeldung/spring/data/dynamodb/repository/ProductInfoRepositoryIntegrationTest.java @@ -1,4 +1,4 @@ -package com.baeldung.spring.data.es.repository; +package com.baeldung.spring.data.dynamodb.repository; import com.amazonaws.services.dynamodbv2.AmazonDynamoDB; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper; @@ -6,8 +6,8 @@ import com.amazonaws.services.dynamodbv2.model.CreateTableRequest; import com.amazonaws.services.dynamodbv2.model.ProvisionedThroughput; import com.amazonaws.services.dynamodbv2.model.ResourceInUseException; import com.baeldung.Application; -import com.baeldung.spring.data.es.model.ProductInfo; -import com.baeldung.spring.data.es.repositories.ProductInfoRepository; +import com.baeldung.spring.data.dynamodb.model.ProductInfo; +import com.baeldung.spring.data.dynamodb.repositories.ProductInfoRepository; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/spring-boot-data-dynamodb/src/test/resources/application.properties b/spring-data-dynamodb/src/test/resources/application.properties similarity index 100% rename from spring-boot-data-dynamodb/src/test/resources/application.properties rename to spring-data-dynamodb/src/test/resources/application.properties diff --git a/spring-boot-data-dynamodb/src/test/resources/exception-hibernate.properties b/spring-data-dynamodb/src/test/resources/exception-hibernate.properties similarity index 100% rename from spring-boot-data-dynamodb/src/test/resources/exception-hibernate.properties rename to spring-data-dynamodb/src/test/resources/exception-hibernate.properties diff --git a/spring-boot-data-dynamodb/src/test/resources/exception.properties b/spring-data-dynamodb/src/test/resources/exception.properties similarity index 100% rename from spring-boot-data-dynamodb/src/test/resources/exception.properties rename to spring-data-dynamodb/src/test/resources/exception.properties From 9d735eb663f5f687bdb2ace39795ec74ffc9790f Mon Sep 17 00:00:00 2001 From: Chris Anatalio Date: Wed, 26 Oct 2016 17:33:36 -0700 Subject: [PATCH 2/2] BAEL-223: Add Ignore annotation to tests since there is not local dynamoDB instance in cloud environment --- .../repository/ProductInfoRepositoryIntegrationTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spring-data-dynamodb/src/test/java/com/baeldung/spring/data/dynamodb/repository/ProductInfoRepositoryIntegrationTest.java b/spring-data-dynamodb/src/test/java/com/baeldung/spring/data/dynamodb/repository/ProductInfoRepositoryIntegrationTest.java index e384f7dff4..8fe3e96940 100644 --- a/spring-data-dynamodb/src/test/java/com/baeldung/spring/data/dynamodb/repository/ProductInfoRepositoryIntegrationTest.java +++ b/spring-data-dynamodb/src/test/java/com/baeldung/spring/data/dynamodb/repository/ProductInfoRepositoryIntegrationTest.java @@ -9,6 +9,7 @@ import com.baeldung.Application; import com.baeldung.spring.data.dynamodb.model.ProductInfo; import com.baeldung.spring.data.dynamodb.repositories.ProductInfoRepository; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -43,6 +44,7 @@ public class ProductInfoRepositoryIntegrationTest { private static final String EXPECTED_PRICE = "50"; @Before + @Ignore //TODO Remove Ignore annotations when running locally with Local DynamoDB instance public void setup() throws Exception { try { @@ -62,6 +64,7 @@ public class ProductInfoRepositoryIntegrationTest { } @Test + @Ignore //TODO Remove Ignore annotations when running locally with Local DynamoDB instance public void givenItemWithExpectedCost_whenRunFindAll_thenItemIsFound() { ProductInfo productInfo = new ProductInfo(EXPECTED_COST, EXPECTED_PRICE);