use of org.springframework.data.mongodb.core.convert.MappingMongoConverter in project spring-data-mongodb by spring-projects.
the class MongoQueryExecutionUnitTests method setUp.
@Before
@SuppressWarnings("unchecked")
public void setUp() {
converter = new MappingMongoConverter(dbRefResolver, context);
when(mongoOperationsMock.getConverter()).thenReturn(converter);
when(mongoOperationsMock.query(any(Class.class))).thenReturn(findOperationMock);
}
use of org.springframework.data.mongodb.core.convert.MappingMongoConverter in project spring-data-mongodb by spring-projects.
the class PartTreeMongoQueryUnitTests method setUp.
@Before
public void setUp() {
mappingContext = new MongoMappingContext();
DbRefResolver dbRefResolver = new DefaultDbRefResolver(mock(MongoDbFactory.class));
MongoConverter converter = new MappingMongoConverter(dbRefResolver, mappingContext);
doReturn(converter).when(mongoOperationsMock).getConverter();
doReturn(findOperationMock).when(mongoOperationsMock).query(any());
}
use of org.springframework.data.mongodb.core.convert.MappingMongoConverter in project spring-data-mongodb by spring-projects.
the class UnwrapAndReadDocumentCallbackUnitTests method setUp.
@Before
public void setUp() {
when(factory.getExceptionTranslator()).thenReturn(exceptionTranslatorMock);
MongoTemplate template = new MongoTemplate(factory);
MappingMongoConverter converter = new MappingMongoConverter(new DefaultDbRefResolver(factory), new MongoMappingContext());
this.callback = template.new UnwrapAndReadDocumentCallback(converter, Target.class, "collection-1");
}
use of org.springframework.data.mongodb.core.convert.MappingMongoConverter in project spring-data-mongodb by spring-projects.
the class FilterExpressionUnitTests method setUp.
@Before
public void setUp() {
mappingContext = new MongoMappingContext();
aggregationContext = new TypeBasedAggregationOperationContext(Sales.class, mappingContext, new QueryMapper(new MappingMongoConverter(new DefaultDbRefResolver(mongoDbFactory), mappingContext)));
}
use of org.springframework.data.mongodb.core.convert.MappingMongoConverter in project spring-data-mongodb by spring-projects.
the class GenericMappingTests method setUp.
@Before
public void setUp() throws Exception {
context = new MongoMappingContext();
context.setInitialEntitySet(Collections.singleton(StringWrapper.class));
context.initialize();
converter = new MappingMongoConverter(resolver, context);
}
Aggregations