Skip to content

Commit 612f4f3

Browse files
committed
Fix unit tests for release & document new Maven coordinates
1 parent 6d60911 commit 612f4f3

File tree

9 files changed

+87
-15
lines changed

9 files changed

+87
-15
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ or in XML...
115115
xsi:schemaLocation="http://www.springframework.org/schema/beans
116116
http://www.springframework.org/schema/beans/spring-beans.xsd
117117
http://docs.socialsignin.org/schema/data/dynamodb
118-
http://docs.socialsignin.org/schema/data/dynamodb/spring-dynamodb.xsd">
118+
http://spring-data-dynamodb.github.io/spring-data-dynamodb/spring-dynamodb-1.0.xsd">
119119

120120
<bean id="amazonDynamoDB" class="com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient">
121121
<constructor-arg ref="amazonAWSCredentials" />
@@ -219,7 +219,7 @@ public interface UserRepository extends PagingAndSortingRepository<User, String>
219219

220220
@EnableScan
221221
@EnableScanCount
222-
public Page<User> findAll(Pageable pageable);
222+
Page<User> findAll(Pageable pageable);
223223
}
224224
```
225225

@@ -291,7 +291,8 @@ The code base has some history already in it - let's clarify it a bit:
291291
* Ultimately transferred to [github.com/spring-data-dynamodb/spring-data-dynamodb)](https://github.com/spring-data-dynamodb/spring-data-dynamodb)
292292
* Available in Maven Central under [`com.github.spring-data-dynamodb:spring-data-dynamodb`](http://central.maven.org/maven2/com/github/spring-data-dynamodb/spring-data-dynamodb/)
293293

294-
The whole Java package never changed from `org.socialsignin.spring.data.dynamodb`
294+
The Java package name/XSD namespace never changed from `org.socialsignin.spring.data.dynamodb`.
295+
But the XSD is now also available at [`https://spring-data-dynamodb.github.io/spring-data-dynamodb/spring-dynamodb-1.0.xsd`](https://spring-data-dynamodb.github.io/spring-data-dynamodb/spring-dynamodb-1.0.xsd).
295296

296297
## Advanced topics ##
297298
Advanced topics can be found in the [wiki](https://github.com/spring-data-dynamodb/spring-data-dynamodb/wiki).

pom.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737
</licenses>
3838

3939
<properties>
40-
<spring.version>5.0.1.RELEASE</spring.version>
41-
<spring-data.version>Kay-SR1</spring-data.version>
40+
<spring.version>5.0.4.RELEASE</spring.version>
41+
<spring-data.version>Kay-SR5</spring-data.version>
4242

4343
<hibernate-validator.version>5.2.4.Final</hibernate-validator.version>
44-
<aws-java-sdk.version>1.11.232</aws-java-sdk.version>
44+
<aws-java-sdk.version>1.11.289</aws-java-sdk.version>
4545
<junit.version>4.12</junit.version>
4646
<mockito.version>2.13.0</mockito.version>
4747

@@ -148,6 +148,7 @@
148148
<groupId>org.springframework.data</groupId>
149149
<artifactId>spring-data-commons</artifactId>
150150
</dependency>
151+
151152
<dependency>
152153
<groupId>org.hibernate</groupId>
153154
<artifactId>hibernate-validator</artifactId>
@@ -500,6 +501,7 @@
500501
<artifactId>maven-failsafe-plugin</artifactId>
501502
<configuration>
502503
<systemPropertyVariables>
504+
<sqlite4java.library.path>${project.build.directory}/lib</sqlite4java.library.path>
503505
<dynamodb.port>${dynamodblocal.port}</dynamodb.port>
504506
</systemPropertyVariables>
505507
</configuration>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
org.springframework.data.dynamodb.repository.cdi.JpaRepositoryExtension
1+
org.socialsignin.spring.data.dynamodb.repository.cdi.DynamoDBRepositoryExtension

src/main/resources/org/socialsignin/spring/data/dynamodb/repository/config/spring-dynamodb-1.0.xsd

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,33 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!--
3+
4+
Copyright © 2018 spring-data-dynamodb (https://github.com/spring-data-dynamodb/spring-data-dynamodb)
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
18+
-->
219
<xsd:schema xmlns="http://docs.socialsignin.org/schema/data/dynamodb"
3-
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
4-
xmlns:tool="http://www.springframework.org/schema/tool"
5-
xmlns:repository="http://www.springframework.org/schema/data/repository"
6-
targetNamespace="http://docs.socialsignin.org/schema/data/dynamodb"
7-
elementFormDefault="qualified" attributeFormDefault="unqualified">
20+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
21+
xmlns:tool="http://www.springframework.org/schema/tool"
22+
xmlns:context="http://www.springframework.org/schema/context"
23+
xmlns:repository="http://www.springframework.org/schema/data/repository"
24+
targetNamespace="http://docs.socialsignin.org/schema/data/dynamodb"
25+
elementFormDefault="qualified" attributeFormDefault="unqualified">
826

927
<xsd:import namespace="http://www.springframework.org/schema/tool" />
1028
<xsd:import namespace="http://www.springframework.org/schema/context" />
1129
<xsd:import namespace="http://www.springframework.org/schema/data/repository"
12-
schemaLocation="http://www.springframework.org/schema/data/repository/spring-repository.xsd" />
30+
schemaLocation="http://www.springframework.org/schema/data/repository/spring-repository.xsd" />
1331

1432
<xsd:element name="repositories">
1533
<xsd:complexType>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../main/resources/org/socialsignin/spring/data/dynamodb/repository/config/spring-dynamodb-1.0.xsd

src/test/java/org/socialsignin/spring/data/dynamodb/config/AuditingViaJavaConfigRepositoriesIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public void setup() {
118118
@Test
119119
public void basicAuditing() {
120120

121-
doReturn(this.auditor.getId()).when(this.auditorAware).getCurrentAuditor();
121+
doReturn(Optional.of(this.auditor.getId())).when(this.auditorAware).getCurrentAuditor();
122122

123123
AuditableUser savedUser = auditableUserRepository.save(new AuditableUser("user"));
124124

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* Copyright © 2018 spring-data-dynamodb (https://github.com/spring-data-dynamodb/spring-data-dynamodb)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.socialsignin.spring.data.dynamodb.core;
17+
18+
import com.amazonaws.services.dynamodbv2.AmazonDynamoDB;
19+
import com.amazonaws.services.dynamodbv2.local.embedded.DynamoDBEmbedded;
20+
import org.springframework.context.annotation.Bean;
21+
import org.springframework.context.annotation.Configuration;
22+
23+
@Configuration
24+
public class ConfigurationTI {
25+
26+
@Bean
27+
public AmazonDynamoDB amazonDynamoDB() {
28+
AmazonDynamoDB ddb = DynamoDBEmbedded.create().amazonDynamoDB();
29+
return ddb;
30+
}
31+
}

src/test/java/org/socialsignin/spring/data/dynamodb/domain/sample/HashRangeKeyIT.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
*/
1616
package org.socialsignin.spring.data.dynamodb.domain.sample;
1717

18+
import com.amazonaws.services.dynamodbv2.AmazonDynamoDB;
19+
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper;
20+
import com.amazonaws.services.dynamodbv2.model.CreateTableRequest;
21+
import com.amazonaws.services.dynamodbv2.model.ProvisionedThroughput;
22+
import org.junit.Before;
1823
import org.junit.Test;
1924
import org.junit.runner.RunWith;
2025
import org.springframework.beans.factory.annotation.Autowired;
@@ -37,7 +42,17 @@
3742
public class HashRangeKeyIT {
3843

3944
@Autowired
40-
PlaylistRepository playlistRepository;
45+
private PlaylistRepository playlistRepository;
46+
47+
@Autowired
48+
private AmazonDynamoDB ddb;
49+
50+
@Before
51+
public void setUp() {
52+
CreateTableRequest ctr = new DynamoDBMapper(ddb).generateCreateTableRequest(Playlist.class);
53+
ctr.withProvisionedThroughput(new ProvisionedThroughput(10L, 10L));
54+
ddb.createTable(ctr);
55+
}
4156

4257
@Test
4358
public void runCrudOperations() {

src/test/resources/META-INF/context/HashRangeKeyIT-context.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@
33
xmlns:context="http://www.springframework.org/schema/context"
44
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
55
xmlns:dynamodb="http://docs.socialsignin.org/schema/data/dynamodb"
6+
xmlns:repository="http://www.springframework.org/schema/data/repository"
67
xsi:schemaLocation="
78
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
89
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
910
http://docs.socialsignin.org/schema/data/dynamodb http://docs.socialsignin.org/schema/data/dynamodb/spring-dynamodb-1.0.xsd">
1011

1112

13+
14+
1215
<context:component-scan base-package="org.socialsignin.spring.data.dynamodb.core">
1316
<context:include-filter type="regex" expression="org\.socialsignin\.spring\.data\.dynamodb\.core\.ConfigurationTI"/>
1417
</context:component-scan>
1518

1619
<dynamodb:repositories base-package="org.socialsignin.spring.data.dynamodb.domain.sample" amazon-dynamodb-ref="amazonDynamoDB">
20+
<repository:include-filter type="regex" expression="org\.socialsignin\.spring\.data\.dynamodb\.domain\.sample\.PlaylistRepository" />
1721
</dynamodb:repositories>
1822

1923
</beans>

0 commit comments

Comments
 (0)