use of org.springframework.integration.transformer.ClaimCheckOutTransformer in project spring-integration by spring-projects.
the class MongoDbMessageStoreClaimCheckIntegrationTests method stringPayloadConfigurable.
@Test
@MongoDbAvailable
public void stringPayloadConfigurable() throws Exception {
MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(new MongoClient(), "test");
ConfigurableMongoDbMessageStore messageStore = new ConfigurableMongoDbMessageStore(mongoDbFactory);
GenericApplicationContext testApplicationContext = TestUtils.createTestApplicationContext();
testApplicationContext.refresh();
messageStore.setApplicationContext(testApplicationContext);
messageStore.afterPropertiesSet();
ClaimCheckInTransformer checkin = new ClaimCheckInTransformer(messageStore);
ClaimCheckOutTransformer checkout = new ClaimCheckOutTransformer(messageStore);
Message<?> originalMessage = MessageBuilder.withPayload("test1").build();
Message<?> claimCheckMessage = checkin.transform(originalMessage);
assertEquals(originalMessage.getHeaders().getId(), claimCheckMessage.getPayload());
Message<?> checkedOutMessage = checkout.transform(claimCheckMessage);
assertEquals(claimCheckMessage.getPayload(), checkedOutMessage.getHeaders().getId());
assertEquals(originalMessage.getPayload(), checkedOutMessage.getPayload());
assertEquals(originalMessage, checkedOutMessage);
}
Aggregations