File tree Expand file tree Collapse file tree 3 files changed +52
-3
lines changed
main/java/org/socialsignin/spring/data/dynamodb/core
test/java/org/socialsignin/spring/data/dynamodb/core Expand file tree Collapse file tree 3 files changed +52
-3
lines changed Original file line number Diff line number Diff line change 1+ <document xmlns =" http://maven.apache.org/changes/1.0.0"
2+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3+ xsi : schemaLocation =" http://maven.apache.org/changes/1.0.0 http://maven.apache.org/xsd/changes-1.0.0.xsd" >
4+ <properties >
5+ <title >spring-data-dynamodb Changes</title >
6+ <author email =" zeeman@zeeman.de" >derjust</author >
7+ </properties >
8+ <body >
9+ <release version =" 5.0.1" date =" " description =" Maintenance release" >
10+ <action dev =" derjust" issue =" 68" type =" fix" date =" 2017-12-01" >
11+ Respecting DynamoDBOperations.batchSave()'s List< FailedBatch> return value and turn it into a BatchWriteException
12+ </action >
13+ <action dev =" derjust" type =" add" date =" 2017-12-01" >
14+ Added maven-changes-plugin to build process
15+ </action >
16+ <action dev =" derjust" type =" add" date =" 2017-12-17" >
17+ Update Mockito and resolve dependency clashes
18+ </action >
19+ <action dev =" Gaurav Rawat" type =" fix" issue =" 91" >>
20+ Fixed false assertion introduced implementing #91
21+ </action >
22+ </release >
23+ <release version =" 5.0.0" date =" 2017-11-27" description =" Spring 5 release" >
24+ <action dev =" derjust" type =" add" >
25+ Added Spring 5 / Spring-Data Kay support
26+ </action >
27+ </release >
28+ <release version =" 4.5.1" date =" 2017-12-19" >
29+ <action dev =" Michael Wyraz" type =" fix" issue =" 91" >
30+ Add constructor to DynamoDBTemplate that takes a preconfigured DynamoDBMapper
31+ </action >
32+ </release >
33+ <release version =" 4.5.2" date =" 2017-12-24" description =" Backport of PR #106" >
34+ <action dev =" Gaurav Rawat" type =" fix" issue =" 91" >>
35+ Fixed false assertion introduced implementing #91
36+ </action >
37+ </release >
38+ </body >
39+ </document >
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public DynamoDBTemplate(AmazonDynamoDB amazonDynamoDB)
5353
5454 DynamoDBTemplate (AmazonDynamoDB amazonDynamoDB , DynamoDBMapperConfig dynamoDBMapperConfig , DynamoDBMapper dynamoDBMapper ) {
5555 this .amazonDynamoDB = amazonDynamoDB ;
56- if (dynamoDBMapperConfig == null ) {
56+ if (dynamoDBMapper == null && dynamoDBMapperConfig == null ) {
5757 this .dynamoDBMapperConfig = DynamoDBMapperConfig .DEFAULT ;
5858 this .dynamoDBMapper = new DynamoDBMapper (amazonDynamoDB );
5959 // Mapper must be null as it could not have been constructed without a Config
Original file line number Diff line number Diff line change 1818import com .amazonaws .services .dynamodbv2 .datamodeling .DynamoDBMapperConfig ;
1919import com .amazonaws .services .dynamodbv2 .datamodeling .DynamoDBMapperConfig .TableNameResolver ;
2020
21+ import static org .junit .Assert .assertTrue ;
22+
2123@ RunWith (MockitoJUnitRunner .class )
2224public class DynamoDBTemplateUnitTest {
2325
@@ -29,12 +31,20 @@ public class DynamoDBTemplateUnitTest {
2931 private DynamoDBMapperConfig dynamoDBMapperConfig ;
3032
3133 private DynamoDBTemplate dynamoDBTemplate ;
32-
34+
3335 @ Before
3436 public void setUp () {
3537 this .dynamoDBTemplate = new DynamoDBTemplate (dynamoDB , dynamoDBMapperConfig , dynamoDBMapper );
3638 }
37-
39+
40+ @ Test
41+ public void testPreconfiguredDynamoDBMapper () {
42+ // Introduced constructor via #91 should not fail its assert
43+ DynamoDBTemplate usePreconfiguredDynamoDBMapper = new DynamoDBTemplate (dynamoDB , dynamoDBMapper );
44+
45+ assertTrue ("The constructor should not fail with an assert error" , true );
46+ }
47+
3848 @ SuppressWarnings ("unchecked" )
3949 @ Test
4050 public void testBatchDelete_CallsCorrectDynamoDBMapperMethod ()
You can’t perform that action at this time.
0 commit comments