use of org.springframework.data.mongodb.core.convert.MongoConverter 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.MongoConverter in project spring-data-mongodb by spring-projects.
the class MongoNamespaceTests method testThirdGridFsTemplateFactory.
// DATAMONGO-823
@Test
public void testThirdGridFsTemplateFactory() {
assertTrue(ctx.containsBean("thirdGridFsTemplate"));
GridFsOperations operations = (GridFsOperations) ctx.getBean("thirdGridFsTemplate");
MongoDbFactory dbf = (MongoDbFactory) getField(operations, "dbFactory");
assertEquals("database", getField(dbf, "databaseName"));
assertEquals("bucketString", getField(operations, "bucket"));
MongoConverter converter = (MongoConverter) getField(operations, "converter");
assertNotNull(converter);
}
use of org.springframework.data.mongodb.core.convert.MongoConverter in project spring-data-mongodb by spring-projects.
the class MongoNamespaceTests method testSecondGridFsTemplateFactory.
// DATAMONGO-628
@Test
public void testSecondGridFsTemplateFactory() {
assertTrue(ctx.containsBean("secondGridFsTemplate"));
GridFsOperations operations = (GridFsOperations) ctx.getBean("secondGridFsTemplate");
MongoDbFactory dbf = (MongoDbFactory) getField(operations, "dbFactory");
assertEquals("database", getField(dbf, "databaseName"));
assertEquals(null, getField(operations, "bucket"));
MongoConverter converter = (MongoConverter) getField(operations, "converter");
assertNotNull(converter);
}
use of org.springframework.data.mongodb.core.convert.MongoConverter in project spring-data-mongodb by spring-projects.
the class MongoNamespaceTests method testMongoTemplateFactory.
// DATAMONGO-140
@Test
public void testMongoTemplateFactory() {
assertTrue(ctx.containsBean("mongoTemplate"));
MongoOperations operations = (MongoOperations) ctx.getBean("mongoTemplate");
MongoDbFactory dbf = (MongoDbFactory) getField(operations, "mongoDbFactory");
assertEquals("database", getField(dbf, "databaseName"));
MongoConverter converter = (MongoConverter) getField(operations, "mongoConverter");
assertNotNull(converter);
}
use of org.springframework.data.mongodb.core.convert.MongoConverter in project spring-data-mongodb by spring-projects.
the class MongoNamespaceTests method testGridFsTemplateFactory.
// DATAMONGO-628
@Test
public void testGridFsTemplateFactory() {
assertTrue(ctx.containsBean("gridFsTemplate"));
GridFsOperations operations = (GridFsOperations) ctx.getBean("gridFsTemplate");
MongoDbFactory dbf = (MongoDbFactory) getField(operations, "dbFactory");
assertEquals("database", getField(dbf, "databaseName"));
MongoConverter converter = (MongoConverter) getField(operations, "converter");
assertNotNull(converter);
}
Aggregations