|
|
@ -1,5 +1,5 @@
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Copyright 2012-2020 the original author or authors.
|
|
|
|
* Copyright 2012-2021 the original author or authors.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
@ -44,8 +44,8 @@ import org.springframework.data.mongodb.MongoDatabaseFactory;
|
|
|
|
import org.springframework.data.mongodb.core.MongoTemplate;
|
|
|
|
import org.springframework.data.mongodb.core.MongoTemplate;
|
|
|
|
import org.springframework.data.mongodb.core.SimpleMongoClientDatabaseFactory;
|
|
|
|
import org.springframework.data.mongodb.core.SimpleMongoClientDatabaseFactory;
|
|
|
|
import org.springframework.data.mongodb.core.convert.MongoCustomConversions;
|
|
|
|
import org.springframework.data.mongodb.core.convert.MongoCustomConversions;
|
|
|
|
import org.springframework.data.mongodb.core.mapping.BasicMongoPersistentEntity;
|
|
|
|
|
|
|
|
import org.springframework.data.mongodb.core.mapping.MongoMappingContext;
|
|
|
|
import org.springframework.data.mongodb.core.mapping.MongoMappingContext;
|
|
|
|
|
|
|
|
import org.springframework.data.mongodb.core.mapping.MongoPersistentEntity;
|
|
|
|
import org.springframework.data.mongodb.core.mapping.MongoPersistentProperty;
|
|
|
|
import org.springframework.data.mongodb.core.mapping.MongoPersistentProperty;
|
|
|
|
import org.springframework.data.mongodb.gridfs.GridFsTemplate;
|
|
|
|
import org.springframework.data.mongodb.gridfs.GridFsTemplate;
|
|
|
|
import org.springframework.test.util.ReflectionTestUtils;
|
|
|
|
import org.springframework.test.util.ReflectionTestUtils;
|
|
|
@ -177,7 +177,7 @@ class MongoDataAutoConfigurationTests {
|
|
|
|
void registersDefaultSimpleTypesWithMappingContext() {
|
|
|
|
void registersDefaultSimpleTypesWithMappingContext() {
|
|
|
|
this.contextRunner.run((context) -> {
|
|
|
|
this.contextRunner.run((context) -> {
|
|
|
|
MongoMappingContext mappingContext = context.getBean(MongoMappingContext.class);
|
|
|
|
MongoMappingContext mappingContext = context.getBean(MongoMappingContext.class);
|
|
|
|
BasicMongoPersistentEntity<?> entity = mappingContext.getPersistentEntity(Sample.class);
|
|
|
|
MongoPersistentEntity<?> entity = mappingContext.getPersistentEntity(Sample.class);
|
|
|
|
MongoPersistentProperty dateProperty = entity.getPersistentProperty("date");
|
|
|
|
MongoPersistentProperty dateProperty = entity.getPersistentProperty("date");
|
|
|
|
assertThat(dateProperty.isEntity()).isFalse();
|
|
|
|
assertThat(dateProperty.isEntity()).isFalse();
|
|
|
|
});
|
|
|
|
});
|
|
|
|