Compare commits

..

13 Commits

Author SHA1 Message Date
Mark Paluch
b4befc36c0 DATAMONGO-2608 - Release version 3.1 RC1 (2020.0.0). 2020-09-16 13:57:41 +02:00
Mark Paluch
6034fc1cbd DATAMONGO-2608 - Prepare 3.1 RC1 (2020.0.0). 2020-09-16 13:57:08 +02:00
Mark Paluch
61f4770b4a DATAMONGO-2608 - Updated changelog. 2020-09-16 13:56:57 +02:00
Mark Paluch
c9cfe7acd6 DATAMONGO-2609 - Updated changelog. 2020-09-16 12:16:30 +02:00
Mark Paluch
415ceeef63 DATAMONGO-2593 - Updated changelog. 2020-09-16 11:20:07 +02:00
Mark Paluch
1bdcb88430 DATAMONGO-2592 - Updated changelog. 2020-09-16 10:38:57 +02:00
Christoph Strobl
1a134aa444 DATAMONGO-2618 - Fix visibility of ReplaceRootDocumentOperation. 2020-09-14 13:43:56 +02:00
Mark Paluch
c1da95f5dc DATAMONGO-2621 - Adapt to changed array assertions in AssertJ. 2020-09-09 15:55:48 +02:00
Christoph Strobl
c9c005400c DATAMONGO-2613 - Polishing.
Use the opportunity to remove public modifiers from touched test class.

Original Pull Request: #883
2020-08-20 09:00:21 +02:00
Michal Kurcius
b388659c3f DATAMONGO-2613 - Fix single element ArrayJsonSchemaObject to document mapping.
Now toDocument calls toDocument on items correctly.

Original Pull Request: #883
2020-08-20 08:59:46 +02:00
Mark Paluch
90aa7b8f89 DATAMONGO-2594 - Updated changelog. 2020-08-12 13:25:47 +02:00
Mark Paluch
542de64711 DATAMONGO-2579 - After release cleanups. 2020-08-12 12:00:22 +02:00
Mark Paluch
88b1f9fcb3 DATAMONGO-2579 - Prepare next development iteration. 2020-08-12 12:00:19 +02:00
10 changed files with 100 additions and 49 deletions

View File

@@ -5,7 +5,7 @@
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>3.1.0-M2</version>
<version>3.1.0-RC1</version>
<packaging>pom</packaging>
<name>Spring Data MongoDB</name>
@@ -15,7 +15,7 @@
<parent>
<groupId>org.springframework.data.build</groupId>
<artifactId>spring-data-parent</artifactId>
<version>2.4.0-M2</version>
<version>2.4.0-RC1</version>
</parent>
<modules>
@@ -26,7 +26,7 @@
<properties>
<project.type>multi</project.type>
<dist.id>spring-data-mongodb</dist.id>
<springdata.commons>2.4.0-M2</springdata.commons>
<springdata.commons>2.4.0-RC1</springdata.commons>
<mongo>4.1.0</mongo>
<mongo.reactivestreams>${mongo}</mongo.reactivestreams>
<jmh.version>1.19</jmh.version>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>3.1.0-M2</version>
<version>3.1.0-RC1</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@@ -14,7 +14,7 @@
<parent>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>3.1.0-M2</version>
<version>3.1.0-RC1</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@@ -11,7 +11,7 @@
<parent>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>3.1.0-M2</version>
<version>3.1.0-RC1</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@@ -175,7 +175,7 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation
*
* @author Mark Paluch
*/
static class ReplaceRootDocumentOperation extends ReplaceRootOperation {
public static class ReplaceRootDocumentOperation extends ReplaceRootOperation {
private final static ReplacementDocument EMPTY = new ReplacementDocument();
private final ReplacementDocument current;

View File

@@ -41,6 +41,7 @@ import org.springframework.util.StringUtils;
*
* @author Christoph Strobl
* @author Mark Paluch
* @author Michał Kurcius
* @since 2.1
*/
public class TypedJsonSchemaObject extends UntypedJsonSchemaObject {
@@ -1203,7 +1204,7 @@ public class TypedJsonSchemaObject extends UntypedJsonSchemaObject {
Document doc = new Document(super.toDocument());
if (!CollectionUtils.isEmpty(items)) {
doc.append("items", items.size() == 1 ? items.iterator().next()
doc.append("items", items.size() == 1 ? items.iterator().next().toDocument()
: items.stream().map(JsonSchemaObject::toDocument).collect(Collectors.toList()));
}

View File

@@ -1867,7 +1867,7 @@ public class MappingMongoConverterUnitTests {
}
};
converter.setCustomConversions(new MongoCustomConversions(Arrays.asList(enumConverter)));
converter.setCustomConversions(new MongoCustomConversions(Collections.singletonList(enumConverter)));
converter.afterPropertiesSet();
DocWithInterfacedEnum result = converter.read(DocWithInterfacedEnum.class, document);
@@ -1878,14 +1878,13 @@ public class MappingMongoConverterUnitTests {
@Test // DATAMONGO-1904
void readsNestedArraysCorrectly() {
List<List<List<Float>>> floats = Arrays.asList(Arrays.asList(Arrays.asList(1.0f, 2.0f)));
List<List<List<Float>>> floats = Collections.singletonList(Collections.singletonList(Arrays.asList(1.0f, 2.0f)));
org.bson.Document document = new org.bson.Document("nestedFloats", floats);
WithNestedLists result = converter.read(WithNestedLists.class, document);
assertThat(result.nestedFloats).hasSize(1);
assertThat(result.nestedFloats).isEqualTo(new float[][][] { { { 1.0f, 2.0f } } });
assertThat(result.nestedFloats).hasDimensions(1, 1).isEqualTo(new float[][][] { { { 1.0f, 2.0f } } });
}
@Test // DATAMONGO-1992

View File

@@ -32,7 +32,6 @@ import java.util.Set;
import org.bson.Document;
import org.junit.jupiter.api.Test;
import org.springframework.data.domain.Range;
import org.springframework.data.domain.Range.*;
@@ -41,15 +40,16 @@ import org.springframework.data.domain.Range.*;
*
* @author Christoph Strobl
* @author Mark Paluch
* @author Michał Kurcius
*/
public class JsonSchemaObjectUnitTests {
class JsonSchemaObjectUnitTests {
// -----------------
// type from class
// -----------------
@Test // DATAMONGO-1849
public void primitiveType() {
void primitiveType() {
assertThat(JsonSchemaObject.of(boolean.class).getTypes()).containsExactly(Type.booleanType());
assertThat(JsonSchemaObject.of(int.class).getTypes()).containsExactly(Type.intType());
@@ -60,7 +60,7 @@ public class JsonSchemaObjectUnitTests {
}
@Test // DATAMONGO-1849
public void objectType() {
void objectType() {
assertThat(JsonSchemaObject.of(Object.class).getTypes()).containsExactly(Type.objectType());
assertThat(JsonSchemaObject.of(Map.class).getTypes()).containsExactly(Type.objectType());
@@ -68,12 +68,12 @@ public class JsonSchemaObjectUnitTests {
}
@Test // DATAMONGO-1849
public void binaryData() {
void binaryData() {
assertThat(JsonSchemaObject.of(byte[].class).getTypes()).containsExactly(Type.binaryType());
}
@Test // DATAMONGO-1849
public void collectionType() {
void collectionType() {
assertThat(JsonSchemaObject.of(Object[].class).getTypes()).containsExactly(Type.arrayType());
assertThat(JsonSchemaObject.of(Collection.class).getTypes()).containsExactly(Type.arrayType());
@@ -82,7 +82,7 @@ public class JsonSchemaObjectUnitTests {
}
@Test // DATAMONGO-1849
public void dateType() {
void dateType() {
assertThat(JsonSchemaObject.of(Date.class).getTypes()).containsExactly(Type.dateType());
}
@@ -91,14 +91,14 @@ public class JsonSchemaObjectUnitTests {
// -----------------
@Test // DATAMONGO-1835
public void objectObjectShouldRenderTypeCorrectly() {
void objectObjectShouldRenderTypeCorrectly() {
assertThat(object().generatedDescription().toDocument())
.isEqualTo(new Document("type", "object").append("description", "Must be an object."));
}
@Test // DATAMONGO-1835
public void objectObjectShouldRenderNrPropertiesCorrectly() {
void objectObjectShouldRenderNrPropertiesCorrectly() {
assertThat(object().propertiesCount(from(inclusive(10)).to(inclusive(20))).generatedDescription().toDocument())
.isEqualTo(new Document("type", "object").append("description", "Must be an object with [10-20] properties.")
@@ -106,7 +106,7 @@ public class JsonSchemaObjectUnitTests {
}
@Test // DATAMONGO-1835
public void objectObjectShouldRenderRequiredPropertiesCorrectly() {
void objectObjectShouldRenderRequiredPropertiesCorrectly() {
assertThat(object().required("spring", "data", "mongodb").generatedDescription().toDocument())
.isEqualTo(new Document("type", "object")
@@ -115,7 +115,7 @@ public class JsonSchemaObjectUnitTests {
}
@Test // DATAMONGO-1835
public void objectObjectShouldRenderAdditionalPropertiesCorrectlyWhenBoolean() {
void objectObjectShouldRenderAdditionalPropertiesCorrectlyWhenBoolean() {
assertThat(object().additionalProperties(true).generatedDescription().toDocument()).isEqualTo(
new Document("type", "object").append("description", "Must be an object allowing additional properties.")
@@ -127,7 +127,7 @@ public class JsonSchemaObjectUnitTests {
}
@Test // DATAMONGO-1835
public void objectObjectShouldRenderPropertiesCorrectly() {
void objectObjectShouldRenderPropertiesCorrectly() {
Document expected = new Document("type", "object")
.append("description", "Must be an object defining restrictions for name, active.").append("properties",
@@ -142,7 +142,7 @@ public class JsonSchemaObjectUnitTests {
}
@Test // DATAMONGO-1835
public void objectObjectShouldRenderNestedObjectPropertiesCorrectly() {
void objectObjectShouldRenderNestedObjectPropertiesCorrectly() {
Document expected = new Document("type", "object")
.append("description", "Must be an object defining restrictions for address.")
@@ -158,7 +158,7 @@ public class JsonSchemaObjectUnitTests {
}
@Test // DATAMONGO-1835
public void objectObjectShouldRenderPatternPropertiesCorrectly() {
void objectObjectShouldRenderPatternPropertiesCorrectly() {
Document expected = new Document("type", "object")
.append("description", "Must be an object defining restrictions for patterns na.*.")
@@ -170,7 +170,7 @@ public class JsonSchemaObjectUnitTests {
}
@Test // DATAMONGO-1849
public void objectShouldIncludeRequiredNestedCorrectly() {
void objectShouldIncludeRequiredNestedCorrectly() {
assertThat(object() //
.properties( //
@@ -185,21 +185,21 @@ public class JsonSchemaObjectUnitTests {
// -----------------
@Test // DATAMONGO-1835
public void stringObjectShouldRenderTypeCorrectly() {
void stringObjectShouldRenderTypeCorrectly() {
assertThat(string().generatedDescription().toDocument())
.isEqualTo(new Document("type", "string").append("description", "Must be a string."));
}
@Test // DATAMONGO-1835
public void stringObjectShouldRenderDescriptionCorrectly() {
void stringObjectShouldRenderDescriptionCorrectly() {
assertThat(string().description("error msg").toDocument())
.isEqualTo(new Document("type", "string").append("description", "error msg"));
}
@Test // DATAMONGO-1835
public void stringObjectShouldRenderRangeCorrectly() {
void stringObjectShouldRenderRangeCorrectly() {
assertThat(string().length(from(inclusive(10)).to(inclusive(20))).generatedDescription().toDocument())
.isEqualTo(new Document("type", "string").append("description", "Must be a string with length [10-20].")
@@ -207,7 +207,7 @@ public class JsonSchemaObjectUnitTests {
}
@Test // DATAMONGO-1835
public void stringObjectShouldRenderPatternCorrectly() {
void stringObjectShouldRenderPatternCorrectly() {
assertThat(string().matching("^spring$").generatedDescription().toDocument())
.isEqualTo(new Document("type", "string").append("description", "Must be a string matching ^spring$.")
@@ -219,7 +219,7 @@ public class JsonSchemaObjectUnitTests {
// -----------------
@Test // DATAMONGO-1835
public void numberObjectShouldRenderMultipleOfCorrectly() {
void numberObjectShouldRenderMultipleOfCorrectly() {
assertThat(number().multipleOf(3.141592F).generatedDescription().toDocument())
.isEqualTo(new Document("type", "number").append("description", "Must be a numeric value multiple of 3.141592.")
@@ -227,7 +227,7 @@ public class JsonSchemaObjectUnitTests {
}
@Test // DATAMONGO-1835
public void numberObjectShouldRenderMaximumCorrectly() {
void numberObjectShouldRenderMaximumCorrectly() {
assertThat(
number().within(Range.of(Bound.unbounded(), Bound.inclusive(3.141592F))).generatedDescription().toDocument())
@@ -243,7 +243,7 @@ public class JsonSchemaObjectUnitTests {
}
@Test // DATAMONGO-1835
public void numberObjectShouldRenderMinimumCorrectly() {
void numberObjectShouldRenderMinimumCorrectly() {
assertThat(
number().within(Range.of(Bound.inclusive(3.141592F), Bound.unbounded())).generatedDescription().toDocument())
@@ -263,35 +263,42 @@ public class JsonSchemaObjectUnitTests {
// -----------------
@Test // DATAMONGO-1835
public void arrayObjectShouldRenderItemsCorrectly() {
void arrayObjectShouldRenderItemsCorrectly() {
assertThat(array().items(Arrays.asList(string(), bool())).toDocument()).isEqualTo(new Document("type", "array")
.append("items", Arrays.asList(new Document("type", "string"), new Document("type", "boolean"))));
}
@Test // DATAMONGO-2613
void arrayObjectShouldRenderItemsCorrectlyAsObjectIfContainsOnlyOneElement() {
assertThat(array().items(Collections.singletonList(string())).toDocument())
.isEqualTo(new Document("type", "array").append("items", new Document("type", "string")));
}
@Test // DATAMONGO-1835
public void arrayObjectShouldRenderMaxItemsCorrectly() {
void arrayObjectShouldRenderMaxItemsCorrectly() {
assertThat(array().maxItems(5).generatedDescription().toDocument()).isEqualTo(new Document("type", "array")
.append("description", "Must be an array having size unbounded-5].").append("maxItems", 5));
}
@Test // DATAMONGO-1835
public void arrayObjectShouldRenderMinItemsCorrectly() {
void arrayObjectShouldRenderMinItemsCorrectly() {
assertThat(array().minItems(5).generatedDescription().toDocument()).isEqualTo(new Document("type", "array")
.append("description", "Must be an array having size [5-unbounded.").append("minItems", 5));
}
@Test // DATAMONGO-1835
public void arrayObjectShouldRenderUniqueItemsCorrectly() {
void arrayObjectShouldRenderUniqueItemsCorrectly() {
assertThat(array().uniqueItems(true).generatedDescription().toDocument()).isEqualTo(new Document("type", "array")
.append("description", "Must be an array of unique values.").append("uniqueItems", true));
}
@Test // DATAMONGO-1835
public void arrayObjectShouldRenderAdditionalItemsItemsCorrectly() {
void arrayObjectShouldRenderAdditionalItemsItemsCorrectly() {
assertThat(array().additionalItems(true).generatedDescription().toDocument())
.isEqualTo(new Document("type", "array").append("description", "Must be an array with additional items.")
@@ -306,7 +313,7 @@ public class JsonSchemaObjectUnitTests {
// -----------------
@Test // DATAMONGO-1835
public void booleanShouldRenderCorrectly() {
void booleanShouldRenderCorrectly() {
assertThat(bool().generatedDescription().toDocument())
.isEqualTo(new Document("type", "boolean").append("description", "Must be a boolean."));
@@ -317,7 +324,7 @@ public class JsonSchemaObjectUnitTests {
// -----------------
@Test // DATAMONGO-1835
public void nullShouldRenderCorrectly() {
void nullShouldRenderCorrectly() {
assertThat(nil().generatedDescription().toDocument())
.isEqualTo(new Document("type", "null").append("description", "Must be null."));
@@ -328,7 +335,7 @@ public class JsonSchemaObjectUnitTests {
// -----------------
@Test // DATAMONGO-1877
public void dateShouldRenderCorrectly() {
void dateShouldRenderCorrectly() {
assertThat(date().generatedDescription().toDocument())
.isEqualTo(new Document("bsonType", "date").append("description", "Must be a date."));
@@ -339,7 +346,7 @@ public class JsonSchemaObjectUnitTests {
// -----------------
@Test // DATAMONGO-1877
public void timestampShouldRenderCorrectly() {
void timestampShouldRenderCorrectly() {
assertThat(timestamp().generatedDescription().toDocument())
.isEqualTo(new Document("bsonType", "timestamp").append("description", "Must be a timestamp."));
@@ -350,35 +357,35 @@ public class JsonSchemaObjectUnitTests {
// -----------------
@Test // DATAMONGO-1835
public void typedObjectShouldRenderEnumCorrectly() {
void typedObjectShouldRenderEnumCorrectly() {
assertThat(of(String.class).possibleValues(Arrays.asList("one", "two")).toDocument())
.isEqualTo(new Document("type", "string").append("enum", Arrays.asList("one", "two")));
}
@Test // DATAMONGO-1835
public void typedObjectShouldRenderAllOfCorrectly() {
void typedObjectShouldRenderAllOfCorrectly() {
assertThat(of(Object.class).allOf(Arrays.asList(string())).toDocument())
.isEqualTo(new Document("type", "object").append("allOf", Arrays.asList(new Document("type", "string"))));
}
@Test // DATAMONGO-1835
public void typedObjectShouldRenderAnyOfCorrectly() {
void typedObjectShouldRenderAnyOfCorrectly() {
assertThat(of(String.class).anyOf(Arrays.asList(string())).toDocument())
.isEqualTo(new Document("type", "string").append("anyOf", Arrays.asList(new Document("type", "string"))));
}
@Test // DATAMONGO-1835
public void typedObjectShouldRenderOneOfCorrectly() {
void typedObjectShouldRenderOneOfCorrectly() {
assertThat(of(String.class).oneOf(Arrays.asList(string())).toDocument())
.isEqualTo(new Document("type", "string").append("oneOf", Arrays.asList(new Document("type", "string"))));
}
@Test // DATAMONGO-1835
public void typedObjectShouldRenderNotCorrectly() {
void typedObjectShouldRenderNotCorrectly() {
assertThat(untyped().notMatch(string()).toDocument())
.isEqualTo(new Document("not", new Document("type", "string")));

View File

@@ -1,6 +1,44 @@
Spring Data MongoDB Changelog
=============================
Changes in version 3.1.0-RC1 (2020-09-16)
-----------------------------------------
* DATAMONGO-2621 - Adapt to changed array assertions in AssertJ.
* DATAMONGO-2618 - ReplaceRootDocumentOperation not visible.
* DATAMONGO-2613 - ArrayJsonSchemaObject incorrectly mapped to Document.
* DATAMONGO-2608 - Release 3.1 RC1 (2020.0.0).
Changes in version 3.0.4.RELEASE (2020-09-16)
---------------------------------------------
* DATAMONGO-2618 - ReplaceRootDocumentOperation not visible.
* DATAMONGO-2613 - ArrayJsonSchemaObject incorrectly mapped to Document.
* DATAMONGO-2609 - Release 3.0.4 (Neumann SR4).
Changes in version 2.2.10.RELEASE (2020-09-16)
----------------------------------------------
* DATAMONGO-2618 - ReplaceRootDocumentOperation not visible.
* DATAMONGO-2613 - ArrayJsonSchemaObject incorrectly mapped to Document.
* DATAMONGO-2599 - Ambiguous field mapping detected for enum java.time.temporal.ChronoUnit.
* DATAMONGO-2593 - Release 2.2.10 (Moore SR10).
Changes in version 2.1.20.RELEASE (2020-09-16)
----------------------------------------------
* DATAMONGO-2618 - ReplaceRootDocumentOperation not visible.
* DATAMONGO-2613 - ArrayJsonSchemaObject incorrectly mapped to Document.
* DATAMONGO-2592 - Release 2.1.20 (Lovelace SR20).
Changes in version 3.0.3.RELEASE (2020-08-12)
---------------------------------------------
* DATAMONGO-2601 - Consider Unit a void type in Coroutine repositories.
* DATAMONGO-2599 - Ambiguous field mapping detected for enum java.time.temporal.ChronoUnit.
* DATAMONGO-2598 - Wording changes.
* DATAMONGO-2594 - Release 3.0.3 (Neumann SR3).
Changes in version 3.1.0-M2 (2020-08-12)
----------------------------------------
* DATAMONGO-2603 - Adopt to Reactor 3.4 changes.
@@ -3126,6 +3164,11 @@ Repository

View File

@@ -1,4 +1,4 @@
Spring Data MongoDB 3.1 M2 (2020.0.0)
Spring Data MongoDB 3.1 RC1 (2020.0.0)
Copyright (c) [2010-2019] Pivotal Software, Inc.
This product is licensed to you under the Apache License, Version 2.0 (the "License").
@@ -17,3 +17,4 @@ conditions of the subcomponent's license, as noted in the LICENSE file.