Skip to content

Commit

Permalink
Merge pull request #223 from derjust/Issue_218
Browse files Browse the repository at this point in the history
Issue #218 - Update to Spring-Data 2.1.2.RELEASE and Spring Framework 5.1.2.RELEAS
  • Loading branch information
derjust committed Nov 28, 2018
2 parents 9356e42 + 82285cf commit 03c017d
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 28 deletions.
12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -37,7 +37,7 @@ Download the JAR though [Maven Central](http://mvnrepository.com/artifact/com.gi
<dependency>
<groupId>com.github.derjust</groupId>
<artifactId>spring-data-dynamodb</artifactId>
<version>5.0.3</version>
<version>5.0.4</version>
</dependency>
```

Expand Down Expand Up @@ -165,11 +165,11 @@ API changes will follow SEMVER and loosly the Spring Framework releases.
| ------------------------------- | ------------------------------ | ------------------------------ | ------------------------- |
| 1.0.x | | >= 3.1 && < 4.2 | |
| 4.2.x | >= 1.3.0 && < 1.4.0 | >= 4.2 && < 4.3 | Gosling-SR1 |
| 4.3.x | >= 1.4.0 < 2.0 | >= 4.3 && < 5.0 | Gosling-SR1 |
| 4.4.x | >= 1.4.0 < 2.0 | >= 4.3 && < 5.0 | Hopper-SR2 |
| 4.5.x | >= 1.4.0 < 2.0 | >= 4.3 && < 5.0 | Ingalls |
| 5.0.x | >= 2.0 | >= 5.0 | Kay-SR1 |

| 4.3.x | >= 1.4.0 && < 2.0 | >= 4.3 && < 5.0 | Gosling-SR1 |
| 4.4.x | >= 1.4.0 && < 2.0 | >= 4.3 && < 5.0 | Hopper-SR2 |
| 4.5.x | >= 1.4.0 && < 2.0 | >= 4.3 && < 5.0 | Ingalls |
| 5.0.x | >= 2.0 && < 2.1 | >= 5.0 && < 5.1 | Kay-SR1 |
| 5.1.x | >= 2.1 | >= 5.1 | Lovelace-SR1 |
`spring-data-dynamodb` depends directly on `spring-data` as also `spring-context`, `spring-data` and `spring-tx`.

`compile` and `runtime` dependencies are kept to a minimum to allow easy integartion, for example into
Expand Down
27 changes: 18 additions & 9 deletions pom.xml
Expand Up @@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.derjust</groupId>
<artifactId>spring-data-dynamodb</artifactId>
<version>5.0.5-SNAPSHOT</version>
<version>5.1.0-SNAPSHOT</version>
<name>Spring Data DynamoDB</name>
<inceptionYear>2018</inceptionYear>

Expand All @@ -37,14 +37,13 @@
</licenses>

<properties>
<spring.version>5.0.4.RELEASE</spring.version>
<spring-data.version>2.0.9.RELEASE</spring-data.version>
<spring.version>5.1.2.RELEASE</spring.version>
<spring-data.version>2.1.2.RELEASE</spring-data.version>

<hibernate-validator.version>6.0.9.Final</hibernate-validator.version>
<aws-java-sdk.version>1.11.301</aws-java-sdk.version>
<aws-java-sdk.version>1.11.443</aws-java-sdk.version>
<junit.version>4.12</junit.version>
<mockito.version>2.13.0</mockito.version>

<mockito.version>2.23.0</mockito.version>
<cdi.version>1.2</cdi.version>
<slf4j-test.version>1.2.0</slf4j-test.version>
<sqlite4java.version>1.0.392</sqlite4java.version>
Expand Down Expand Up @@ -89,7 +88,6 @@
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
</dependency>

<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-bom</artifactId>
Expand Down Expand Up @@ -202,6 +200,9 @@
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.7.2</version>
<configuration>
<lineEnding>LF</lineEnding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -260,7 +261,7 @@
</manifest>
<manifestEntries>
<Specification-Title>Spring Data</Specification-Title>
<Specification-Version>2.0</Specification-Version>
<Specification-Version>2.1</Specification-Version>
</manifestEntries>
</archive>
</configuration>
Expand Down Expand Up @@ -653,7 +654,7 @@
</os>
</activation>
<properties>
<sqlite4java.artifactId>libsqlite4java-win32-x64</sqlite4java.artifactId>
<sqlite4java.artifactId>sqlite4java-win32-x64</sqlite4java.artifactId>
<sqlite4java.type>dll</sqlite4java.type>
</properties>
</profile>
Expand Down Expand Up @@ -794,6 +795,14 @@
<name>Rene Enriquez</name>
<url>enriquezrene</url>
</contributor>
<contributor>
<name>John Dorman</name>
<url>https://github.com/boostchicken</url>
</contributor>
<contributor>
<name>Ryon Day</name>
<url>https://github.com/ryonday</url>
</contributor>
</contributors>


Expand Down
12 changes: 11 additions & 1 deletion src/changes/changes.xml
Expand Up @@ -23,7 +23,17 @@
<author email="zeeman@zeeman.de">derjust</author>
</properties>
<body>
<release version="5.0.4" date="2018-11-27" description="Maintenance &amp; security release">
<release version="5.1.0" date="" description="Spring Boot 2.1 and Spring Data Lovelace-SR1 support">
<action dev="boostschicken" type="add" date="2018-10-28">
Updated all code to work with Spring Boot 2.1 and Lovelace-SR1
</action>
<action dev="boostschicken" type="add" date="2018-10-28">
Updated Mockito to improve test coverage
<action dev="ryonday" issue="218" type="fix" date="2018-11-09">
Update to Spring-Data 2.1.2.RELEASE and Spring Framework 5.1.2.RELEASE
</action>
</release>
<release version="5.0.4" date="2018-11-27" description="Maintenance &amp; security release">
<action dev="enriquezrene" issue="199" type="fix" date="2018-10-11">
Fix README.md examples
</action>
Expand Down
Expand Up @@ -25,9 +25,9 @@
import org.springframework.data.repository.core.RepositoryInformation;
import org.springframework.data.repository.core.RepositoryMetadata;
import org.springframework.data.repository.core.support.RepositoryFactorySupport;
import org.springframework.data.repository.query.EvaluationContextProvider;
import org.springframework.data.repository.query.QueryLookupStrategy;
import org.springframework.data.repository.query.QueryLookupStrategy.Key;
import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider;
import org.springframework.data.util.Version;

import java.io.Serializable;
Expand Down Expand Up @@ -108,7 +108,7 @@ public <T, ID> DynamoDBEntityInformation<T, ID> getEntityInformation(final Class

@Override
protected Optional<QueryLookupStrategy> getQueryLookupStrategy(Key key,
EvaluationContextProvider evaluationContextProvider) {
QueryMethodEvaluationContextProvider evaluationContextProvider) {
return Optional.of(DynamoDBQueryLookupStrategy.create(dynamoDBOperations, key));
}

Expand Down
Expand Up @@ -64,6 +64,7 @@ public class DynamoDBAuditingBeanDefinitionParserTest {
private ParserContext parserContext;
@Mock
private BeanDefinitionRegistry registry;

@Mock
private BeanDefinitionBuilder builder;

Expand Down
Expand Up @@ -94,7 +94,7 @@ public void testHashCode() {
public void testToString() {
String actual = underTest.toString();

assertTrue(actual, actual.startsWith("Page 1 of 1 containing codegen.java.util.Iterator$MockitoMock"));
assertTrue(actual, actual.startsWith("Page 1 of 1 containing org.mockito.codegen.Iterator$MockitoMock"));
}

@Test
Expand Down
Expand Up @@ -139,16 +139,8 @@ private <T, ID extends Serializable> void setupCommonMocksForThisRepositoryMetho
Mockito.when(mockEntityMetadata.isRangeKeyAware()).thenReturn(true);
}

// Dirty Harry 9 3/4: In recent versions of spring-data-commons, a lot of
// methods within
// org.springframework.data.repository.query.QueryMethod have become final. Thus
// they can't
// be mocked by Mockito anymore
// https://github.com/mockito/mockito/wiki/FAQ#what-are-the-limitations-of-mockito
// Therefore setting the field explicitly that is used by all the isXXX methods
try {
Field unwrappedReturnTypeField = mockDynamoDBQueryMethod.getClass() // Mockito-generated class
.getSuperclass() // org.socialsignin.spring.data.dynamodb.repository.query.DynamoDBQueryMethod
Field unwrappedReturnTypeField = mockDynamoDBQueryMethod.getClass() // org.socialsignin.spring.data.dynamodb.repository.query.DynamoDBQueryMethod
.getSuperclass() // org.springframework.data.repository.query.QueryMethod
.getDeclaredField("unwrappedReturnType");
unwrappedReturnTypeField.setAccessible(true); // It's final therefore unlocking the field
Expand Down
@@ -0,0 +1 @@
mock-maker-inline

0 comments on commit 03c017d

Please sign in to comment.