Search in sources :

Example 1 with GridFsOperations

use of org.springframework.data.mongodb.gridfs.GridFsOperations 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);
}
Also used : MongoDbFactory(org.springframework.data.mongodb.MongoDbFactory) MongoConverter(org.springframework.data.mongodb.core.convert.MongoConverter) GridFsOperations(org.springframework.data.mongodb.gridfs.GridFsOperations) Test(org.junit.Test)

Example 2 with GridFsOperations

use of org.springframework.data.mongodb.gridfs.GridFsOperations 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);
}
Also used : MongoDbFactory(org.springframework.data.mongodb.MongoDbFactory) MongoConverter(org.springframework.data.mongodb.core.convert.MongoConverter) GridFsOperations(org.springframework.data.mongodb.gridfs.GridFsOperations) Test(org.junit.Test)

Example 3 with GridFsOperations

use of org.springframework.data.mongodb.gridfs.GridFsOperations 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);
}
Also used : MongoDbFactory(org.springframework.data.mongodb.MongoDbFactory) MongoConverter(org.springframework.data.mongodb.core.convert.MongoConverter) GridFsOperations(org.springframework.data.mongodb.gridfs.GridFsOperations) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 MongoDbFactory (org.springframework.data.mongodb.MongoDbFactory)3 MongoConverter (org.springframework.data.mongodb.core.convert.MongoConverter)3 GridFsOperations (org.springframework.data.mongodb.gridfs.GridFsOperations)3