Update tests.

Original Pull Request: #4196
This commit is contained in:
Christoph Strobl
2022-10-10 14:40:52 +02:00
parent b59c7f774f
commit 49cd518647
3 changed files with 6 additions and 4 deletions

View File

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

View File

@@ -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.Query;
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.MongoTestTemplate;
import org.springframework.data.mongodb.test.util.MongoVersion;
@@ -315,6 +316,7 @@ public class AggregationTests {
}
@Test // DATAMONGO-1391
@EnableIfMongoServerVersion(isLessThan = "6.0")
void shouldUnwindPreserveEmpty() {
MongoCollection<Document> coll = mongoTemplate.getCollection(INPUT_COLLECTION);

View File

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