Browse Source

Update tests.

Original Pull Request: #4196
3.3.x
Christoph Strobl 3 years ago
parent
commit
49cd518647
No known key found for this signature in database
GPG Key ID: 8CC1AB53391458C8
  1. 2
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MappingMongoJsonSchemaCreatorUnitTests.java
  2. 2
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/AggregationTests.java
  3. 6
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/schema/JsonSchemaObjectUnitTests.java

2
spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MappingMongoJsonSchemaCreatorUnitTests.java

@ -179,7 +179,7 @@ public class MappingMongoJsonSchemaCreatorUnitTests {
" 're-named-property' : { 'type' : 'string' }," + // " 're-named-property' : { 'type' : 'string' }," + //
" 'retypedProperty' : { 'bsonType' : 'javascript' }," + // " 'retypedProperty' : { 'bsonType' : 'javascript' }," + //
" 'primitiveInt' : { 'bsonType' : 'int' }," + // " 'primitiveInt' : { 'bsonType' : 'int' }," + //
" 'booleanProperty' : { 'type' : 'boolean' }," + // " 'booleanProperty' : { 'type' : 'bool' }," + //
" 'longProperty' : { 'bsonType' : 'long' }," + // " 'longProperty' : { 'bsonType' : 'long' }," + //
" 'intProperty' : { 'bsonType' : 'int' }," + // " 'intProperty' : { 'bsonType' : 'int' }," + //
" 'dateProperty' : { 'bsonType' : 'date' }," + // " 'dateProperty' : { 'bsonType' : 'date' }," + //

2
spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/AggregationTests.java

@ -66,6 +66,7 @@ import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.NearQuery; import org.springframework.data.mongodb.core.query.NearQuery;
import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.repository.Person; import org.springframework.data.mongodb.repository.Person;
import org.springframework.data.mongodb.test.util.EnableIfMongoServerVersion;
import org.springframework.data.mongodb.test.util.MongoTemplateExtension; import org.springframework.data.mongodb.test.util.MongoTemplateExtension;
import org.springframework.data.mongodb.test.util.MongoTestTemplate; import org.springframework.data.mongodb.test.util.MongoTestTemplate;
import org.springframework.data.mongodb.test.util.MongoVersion; import org.springframework.data.mongodb.test.util.MongoVersion;
@ -315,6 +316,7 @@ public class AggregationTests {
} }
@Test // DATAMONGO-1391 @Test // DATAMONGO-1391
@EnableIfMongoServerVersion(isLessThan = "6.0")
void shouldUnwindPreserveEmpty() { void shouldUnwindPreserveEmpty() {
MongoCollection<Document> coll = mongoTemplate.getCollection(INPUT_COLLECTION); MongoCollection<Document> coll = mongoTemplate.getCollection(INPUT_COLLECTION);

6
spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/schema/JsonSchemaObjectUnitTests.java

@ -133,7 +133,7 @@ class JsonSchemaObjectUnitTests {
.append("description", "Must be an object defining restrictions for name, active.").append("properties", .append("description", "Must be an object defining restrictions for name, active.").append("properties",
new Document("name", new Document("type", "string") new Document("name", new Document("type", "string")
.append("description", "Must be a string with length unbounded-10].").append("maxLength", 10)) .append("description", "Must be a string with length unbounded-10].").append("maxLength", 10))
.append("active", new Document("type", "boolean"))); .append("active", new Document("type", "bool")));
assertThat(object().generatedDescription() assertThat(object().generatedDescription()
.properties(JsonSchemaProperty.string("name").maxLength(10).generatedDescription(), .properties(JsonSchemaProperty.string("name").maxLength(10).generatedDescription(),
@ -266,7 +266,7 @@ class JsonSchemaObjectUnitTests {
void arrayObjectShouldRenderItemsCorrectly() { void arrayObjectShouldRenderItemsCorrectly() {
assertThat(array().items(Arrays.asList(string(), bool())).toDocument()).isEqualTo(new Document("type", "array") 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")))); .append("items", Arrays.asList(new Document("type", "string"), new Document("type", "bool"))));
} }
@Test // DATAMONGO-2613 @Test // DATAMONGO-2613
@ -316,7 +316,7 @@ class JsonSchemaObjectUnitTests {
void booleanShouldRenderCorrectly() { void booleanShouldRenderCorrectly() {
assertThat(bool().generatedDescription().toDocument()) assertThat(bool().generatedDescription().toDocument())
.isEqualTo(new Document("type", "boolean").append("description", "Must be a boolean.")); .isEqualTo(new Document("type", "bool").append("description", "Must be a boolean."));
} }
// ----------------- // -----------------

Loading…
Cancel
Save