use of org.springframework.integration.mongodb.inbound.MongoDbMessageSource in project spring-integration by spring-projects.
the class MongoDbInboundChannelAdapterParserTests method fullConfigWithMongoTemplate.
@Test
public void fullConfigWithMongoTemplate() {
MongoDbMessageSource source = TestUtils.getPropertyValue(this.fullConfigWithMongoTemplateAdapter, "source", MongoDbMessageSource.class);
assertEquals(false, TestUtils.getPropertyValue(this.fullConfigWithMongoTemplateAdapter, "shouldTrack"));
assertNotNull(TestUtils.getPropertyValue(source, "mongoTemplate"));
assertSame(this.mongoDbTemplate, TestUtils.getPropertyValue(source, "mongoTemplate"));
assertNotNull(TestUtils.getPropertyValue(source, "evaluationContext"));
assertTrue(TestUtils.getPropertyValue(source, "collectionNameExpression") instanceof LiteralExpression);
assertEquals("foo", TestUtils.getPropertyValue(source, "collectionNameExpression.literalValue"));
}
use of org.springframework.integration.mongodb.inbound.MongoDbMessageSource in project spring-integration by spring-projects.
the class MongoDbInboundChannelAdapterParserTests method fullConfigWithSpelQuery.
@Test
public void fullConfigWithSpelQuery() {
MongoDbMessageSource source = assertMongoDbMessageSource(this.fullConfigWithSpelQueryAdapter);
assertTrue(TestUtils.getPropertyValue(source, "queryExpression") instanceof LiteralExpression);
assertEquals("{''address.state'' : ''PA''}", TestUtils.getPropertyValue(source, "queryExpression.literalValue"));
}
use of org.springframework.integration.mongodb.inbound.MongoDbMessageSource in project spring-integration by spring-projects.
the class MongoDbInboundChannelAdapterParserTests method fullConfigWithCollectionName.
@Test
public void fullConfigWithCollectionName() {
MongoDbMessageSource source = assertMongoDbMessageSource(this.fullConfigWithCollectionNameAdapter);
assertTrue(TestUtils.getPropertyValue(source, "collectionNameExpression") instanceof LiteralExpression);
assertEquals("foo", TestUtils.getPropertyValue(source, "collectionNameExpression.literalValue"));
}
use of org.springframework.integration.mongodb.inbound.MongoDbMessageSource in project spring-integration by spring-projects.
the class MongoDbInboundChannelAdapterParserTests method assertMongoDbMessageSource.
private MongoDbMessageSource assertMongoDbMessageSource(Object testedBean) {
MongoDbMessageSource source = TestUtils.getPropertyValue(testedBean, "source", MongoDbMessageSource.class);
assertEquals(false, TestUtils.getPropertyValue(testedBean, "shouldTrack"));
assertNotNull(TestUtils.getPropertyValue(source, "mongoTemplate"));
assertEquals(this.mongoDbFactory, TestUtils.getPropertyValue(source, "mongoDbFactory"));
assertEquals(this.mongoConverter, TestUtils.getPropertyValue(source, "mongoConverter"));
assertNotNull(TestUtils.getPropertyValue(source, "evaluationContext"));
return source;
}
use of org.springframework.integration.mongodb.inbound.MongoDbMessageSource in project spring-integration by spring-projects.
the class MongoDbInboundChannelAdapterParserTests method minimalConfig.
@Test
public void minimalConfig() {
MongoDbMessageSource source = TestUtils.getPropertyValue(this.minimalConfigAdapter, "source", MongoDbMessageSource.class);
assertEquals(false, TestUtils.getPropertyValue(this.minimalConfigAdapter, "shouldTrack"));
assertNotNull(TestUtils.getPropertyValue(source, "mongoTemplate"));
assertEquals(this.mongoDbFactory, TestUtils.getPropertyValue(source, "mongoDbFactory"));
assertNotNull(TestUtils.getPropertyValue(source, "evaluationContext"));
assertTrue(TestUtils.getPropertyValue(source, "collectionNameExpression") instanceof LiteralExpression);
assertEquals("data", TestUtils.getPropertyValue(source, "collectionNameExpression.literalValue"));
}
Aggregations