Polishing.
Fix typo in class name and make sure MongoTestTemplate uses the configured simple types. Remove superfluous junit extension. See: #3659 Original pull request: #3661.
This commit is contained in:
committed by
Mark Paluch
parent
a1c165921d
commit
73a0f04933
@@ -1228,6 +1228,7 @@ public class QueryMapper {
|
||||
return propertyPath;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private PersistentPropertyPath<MongoPersistentProperty> tryToResolvePersistentPropertyPath(PropertyPath path) {
|
||||
|
||||
try {
|
||||
|
||||
@@ -28,7 +28,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import lombok.Data;
|
||||
import org.bson.conversions.Bson;
|
||||
import org.bson.types.Code;
|
||||
import org.bson.types.ObjectId;
|
||||
@@ -49,12 +48,10 @@ import org.springframework.data.mongodb.core.geo.GeoJsonPoint;
|
||||
import org.springframework.data.mongodb.core.geo.GeoJsonPolygon;
|
||||
import org.springframework.data.mongodb.core.mapping.DBRef;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
import org.springframework.data.mongodb.core.mapping.DocumentReference;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
import org.springframework.data.mongodb.core.mapping.FieldType;
|
||||
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.TextScore;
|
||||
import org.springframework.data.mongodb.core.mapping.Unwrapped;
|
||||
import org.springframework.data.mongodb.core.query.BasicQuery;
|
||||
@@ -75,7 +72,6 @@ import com.mongodb.client.model.Filters;
|
||||
* @author Christoph Strobl
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
public class QueryMapperUnitTests {
|
||||
|
||||
private QueryMapper mapper;
|
||||
@@ -1447,18 +1443,18 @@ public class QueryMapperUnitTests {
|
||||
@Field("geoJsonPointWithNameViaFieldAnnotation") GeoJsonPoint namedGeoJsonPoint;
|
||||
}
|
||||
|
||||
static class SimpeEntityWithoutId {
|
||||
static class SimpleEntityWithoutId {
|
||||
|
||||
String stringProperty;
|
||||
Integer integerProperty;
|
||||
}
|
||||
|
||||
static class EntityWithComplexValueTypeMap {
|
||||
Map<Integer, SimpeEntityWithoutId> map;
|
||||
Map<Integer, SimpleEntityWithoutId> map;
|
||||
}
|
||||
|
||||
static class EntityWithComplexValueTypeList {
|
||||
List<SimpeEntityWithoutId> list;
|
||||
List<SimpleEntityWithoutId> list;
|
||||
}
|
||||
|
||||
static class WithExplicitTargetTypes {
|
||||
|
||||
@@ -119,6 +119,9 @@ public class MongoTestTemplateConfiguration {
|
||||
mappingContext = new MongoMappingContext();
|
||||
mappingContext.setInitialEntitySet(mappingContextConfigurer.initialEntitySet());
|
||||
mappingContext.setAutoIndexCreation(mappingContextConfigurer.autocreateIndex);
|
||||
if(mongoConverterConfigurer.customConversions != null) {
|
||||
mappingContext.setSimpleTypeHolder(mongoConverterConfigurer.customConversions.getSimpleTypeHolder());
|
||||
}
|
||||
mappingContext.afterPropertiesSet();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user