use of org.springframework.integration.mongodb.outbound.MongoDbStoringMessageHandler in project spring-integration by spring-projects.
the class MongoDbOutboundChannelAdapterParserTests method fullConfigWithCollection.
@Test
public void fullConfigWithCollection() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("outbound-adapter-parser-config.xml", this.getClass());
MongoDbStoringMessageHandler handler = TestUtils.getPropertyValue(context.getBean("fullConfigWithCollection.adapter"), "handler", MongoDbStoringMessageHandler.class);
assertEquals("fullConfigWithCollection.adapter", TestUtils.getPropertyValue(handler, "componentName"));
assertEquals(false, TestUtils.getPropertyValue(handler, "shouldTrack"));
assertNotNull(TestUtils.getPropertyValue(handler, "mongoTemplate"));
assertEquals(context.getBean("mongoDbFactory"), TestUtils.getPropertyValue(handler, "mongoDbFactory"));
assertNotNull(TestUtils.getPropertyValue(handler, "evaluationContext"));
assertTrue(TestUtils.getPropertyValue(handler, "collectionNameExpression") instanceof LiteralExpression);
assertEquals("foo", TestUtils.getPropertyValue(handler, "collectionNameExpression.literalValue"));
context.close();
}
use of org.springframework.integration.mongodb.outbound.MongoDbStoringMessageHandler in project spring-integration by spring-projects.
the class MongoDbOutboundChannelAdapterParserTests method fullConfigWithCollectionExpression.
@Test
public void fullConfigWithCollectionExpression() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("outbound-adapter-parser-config.xml", this.getClass());
MongoDbStoringMessageHandler handler = TestUtils.getPropertyValue(context.getBean("fullConfigWithCollectionExpression.adapter"), "handler", MongoDbStoringMessageHandler.class);
assertEquals("fullConfigWithCollectionExpression.adapter", TestUtils.getPropertyValue(handler, "componentName"));
assertEquals(false, TestUtils.getPropertyValue(handler, "shouldTrack"));
assertNotNull(TestUtils.getPropertyValue(handler, "mongoTemplate"));
assertEquals(context.getBean("mongoDbFactory"), TestUtils.getPropertyValue(handler, "mongoDbFactory"));
assertNotNull(TestUtils.getPropertyValue(handler, "evaluationContext"));
assertTrue(TestUtils.getPropertyValue(handler, "collectionNameExpression") instanceof SpelExpression);
assertEquals("headers.collectionName", TestUtils.getPropertyValue(handler, "collectionNameExpression.expression"));
context.close();
}
use of org.springframework.integration.mongodb.outbound.MongoDbStoringMessageHandler in project spring-integration by spring-projects.
the class MongoDbOutboundChannelAdapterParserTests method minimalConfig.
@Test
public void minimalConfig() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("outbound-adapter-parser-config.xml", this.getClass());
MongoDbStoringMessageHandler handler = TestUtils.getPropertyValue(context.getBean("minimalConfig.adapter"), "handler", MongoDbStoringMessageHandler.class);
assertEquals("minimalConfig.adapter", TestUtils.getPropertyValue(handler, "componentName"));
assertEquals(false, TestUtils.getPropertyValue(handler, "shouldTrack"));
assertNotNull(TestUtils.getPropertyValue(handler, "mongoTemplate"));
assertEquals(context.getBean("mongoDbFactory"), TestUtils.getPropertyValue(handler, "mongoDbFactory"));
assertNotNull(TestUtils.getPropertyValue(handler, "evaluationContext"));
assertTrue(TestUtils.getPropertyValue(handler, "collectionNameExpression") instanceof LiteralExpression);
assertEquals("data", TestUtils.getPropertyValue(handler, "collectionNameExpression.literalValue"));
context.close();
}
use of org.springframework.integration.mongodb.outbound.MongoDbStoringMessageHandler in project spring-integration by spring-projects.
the class MongoDbOutboundChannelAdapterParserTests method fullConfigWithMongoTemplate.
@Test
public void fullConfigWithMongoTemplate() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("outbound-adapter-parser-config.xml", this.getClass());
MongoDbStoringMessageHandler handler = TestUtils.getPropertyValue(context.getBean("fullConfigWithMongoTemplate.adapter"), "handler", MongoDbStoringMessageHandler.class);
assertEquals("fullConfigWithMongoTemplate.adapter", TestUtils.getPropertyValue(handler, "componentName"));
assertEquals(false, TestUtils.getPropertyValue(handler, "shouldTrack"));
assertNotNull(TestUtils.getPropertyValue(handler, "mongoTemplate"));
assertNotNull(TestUtils.getPropertyValue(handler, "evaluationContext"));
assertTrue(TestUtils.getPropertyValue(handler, "collectionNameExpression") instanceof LiteralExpression);
assertEquals("foo", TestUtils.getPropertyValue(handler, "collectionNameExpression.literalValue"));
context.close();
}
Aggregations