Merge pull request #774 from anataliocs/BAEL-223-Integrate-DynamoDB-into-a-Spring-Boot-Application-using-Spring-Data
BAEL-223: Updated package name and project directory
This commit is contained in:
commit
db5970581c
@ -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.AWSCredentials;
|
||||||
import com.amazonaws.auth.BasicAWSCredentials;
|
import com.amazonaws.auth.BasicAWSCredentials;
|
||||||
@ -11,7 +11,7 @@ import org.springframework.context.annotation.Configuration;
|
|||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableDynamoDBRepositories(basePackages = "com.baeldung.spring.data.es.repositories")
|
@EnableDynamoDBRepositories(basePackages = "com.baeldung.spring.data.dynamodb.repositories")
|
||||||
public class DynamoDBConfig {
|
public class DynamoDBConfig {
|
||||||
|
|
||||||
@Value("${amazon.dynamodb.endpoint}")
|
@Value("${amazon.dynamodb.endpoint}")
|
@ -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.DynamoDBAttribute;
|
||||||
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAutoGeneratedKey;
|
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAutoGeneratedKey;
|
@ -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.socialsignin.spring.data.dynamodb.repository.EnableScan;
|
||||||
import org.springframework.data.repository.CrudRepository;
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
|
@ -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.AmazonDynamoDB;
|
||||||
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper;
|
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper;
|
||||||
@ -6,9 +6,10 @@ import com.amazonaws.services.dynamodbv2.model.CreateTableRequest;
|
|||||||
import com.amazonaws.services.dynamodbv2.model.ProvisionedThroughput;
|
import com.amazonaws.services.dynamodbv2.model.ProvisionedThroughput;
|
||||||
import com.amazonaws.services.dynamodbv2.model.ResourceInUseException;
|
import com.amazonaws.services.dynamodbv2.model.ResourceInUseException;
|
||||||
import com.baeldung.Application;
|
import com.baeldung.Application;
|
||||||
import com.baeldung.spring.data.es.model.ProductInfo;
|
import com.baeldung.spring.data.dynamodb.model.ProductInfo;
|
||||||
import com.baeldung.spring.data.es.repositories.ProductInfoRepository;
|
import com.baeldung.spring.data.dynamodb.repositories.ProductInfoRepository;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -43,6 +44,7 @@ public class ProductInfoRepositoryIntegrationTest {
|
|||||||
private static final String EXPECTED_PRICE = "50";
|
private static final String EXPECTED_PRICE = "50";
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
|
@Ignore //TODO Remove Ignore annotations when running locally with Local DynamoDB instance
|
||||||
public void setup() throws Exception {
|
public void setup() throws Exception {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -62,6 +64,7 @@ public class ProductInfoRepositoryIntegrationTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Ignore //TODO Remove Ignore annotations when running locally with Local DynamoDB instance
|
||||||
public void givenItemWithExpectedCost_whenRunFindAll_thenItemIsFound() {
|
public void givenItemWithExpectedCost_whenRunFindAll_thenItemIsFound() {
|
||||||
|
|
||||||
ProductInfo productInfo = new ProductInfo(EXPECTED_COST, EXPECTED_PRICE);
|
ProductInfo productInfo = new ProductInfo(EXPECTED_COST, EXPECTED_PRICE);
|
Loading…
x
Reference in New Issue
Block a user