Search in sources :

Example 1 with UnwrapAndReadDocumentCallback

use of org.springframework.data.mongodb.core.MongoTemplate.UnwrapAndReadDocumentCallback 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");
}
Also used : DefaultDbRefResolver(org.springframework.data.mongodb.core.convert.DefaultDbRefResolver) MongoMappingContext(org.springframework.data.mongodb.core.mapping.MongoMappingContext) MappingMongoConverter(org.springframework.data.mongodb.core.convert.MappingMongoConverter) UnwrapAndReadDocumentCallback(org.springframework.data.mongodb.core.MongoTemplate.UnwrapAndReadDocumentCallback) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 UnwrapAndReadDocumentCallback (org.springframework.data.mongodb.core.MongoTemplate.UnwrapAndReadDocumentCallback)1 DefaultDbRefResolver (org.springframework.data.mongodb.core.convert.DefaultDbRefResolver)1 MappingMongoConverter (org.springframework.data.mongodb.core.convert.MappingMongoConverter)1 MongoMappingContext (org.springframework.data.mongodb.core.mapping.MongoMappingContext)1