use of org.springframework.integration.redis.outbound.RedisStoreWritingMessageHandler in project spring-integration by spring-projects.
the class RedisStoreOutboundChannelAdapterParserTests method validateWithStringObjectTemplate.
@Test
public void validateWithStringObjectTemplate() {
RedisStoreWritingMessageHandler withStringObjectTemplate = TestUtils.getPropertyValue(context.getBean("withStringObjectTemplate.adapter"), "handler", RedisStoreWritingMessageHandler.class);
assertEquals("pepboys", ((LiteralExpression) TestUtils.getPropertyValue(withStringObjectTemplate, "keyExpression")).getExpressionString());
assertEquals("PROPERTIES", (TestUtils.getPropertyValue(withStringObjectTemplate, "collectionType")).toString());
assertFalse(TestUtils.getPropertyValue(withStringObjectTemplate, "redisTemplate") instanceof StringRedisTemplate);
assertTrue(TestUtils.getPropertyValue(withStringObjectTemplate, "redisTemplate.keySerializer") instanceof StringRedisSerializer);
assertTrue(TestUtils.getPropertyValue(withStringObjectTemplate, "redisTemplate.hashKeySerializer") instanceof StringRedisSerializer);
assertTrue(TestUtils.getPropertyValue(withStringObjectTemplate, "redisTemplate.valueSerializer") instanceof JdkSerializationRedisSerializer);
assertTrue(TestUtils.getPropertyValue(withStringObjectTemplate, "redisTemplate.hashValueSerializer") instanceof JdkSerializationRedisSerializer);
}
use of org.springframework.integration.redis.outbound.RedisStoreWritingMessageHandler in project spring-integration by spring-projects.
the class RedisStoreOutboundChannelAdapterParserTests method validateWithStringTemplate.
@Test
public void validateWithStringTemplate() throws Exception {
RedisStoreWritingMessageHandler withStringTemplate = context.getBean("withStringTemplate.handler", RedisStoreWritingMessageHandler.class);
assertEquals("pepboys", ((LiteralExpression) TestUtils.getPropertyValue(withStringTemplate, "keyExpression")).getExpressionString());
assertEquals("PROPERTIES", (TestUtils.getPropertyValue(withStringTemplate, "collectionType")).toString());
assertTrue(TestUtils.getPropertyValue(withStringTemplate, "redisTemplate") instanceof StringRedisTemplate);
Object handler = TestUtils.getPropertyValue(context.getBean("withStringTemplate.adapter"), "handler");
assertTrue(AopUtils.isAopProxy(handler));
assertSame(((Advised) handler).getTargetSource().getTarget(), withStringTemplate);
assertThat(TestUtils.getPropertyValue(handler, "h.advised.advisors.first.item.advice"), Matchers.instanceOf(RequestHandlerRetryAdvice.class));
assertEquals("true", TestUtils.getPropertyValue(withStringTemplate, "zsetIncrementScoreExpression", Expression.class).getExpressionString());
}
use of org.springframework.integration.redis.outbound.RedisStoreWritingMessageHandler in project spring-integration by spring-projects.
the class RedisStoreOutboundChannelAdapterParserTests method validateWithExternalTemplate.
@Test
public void validateWithExternalTemplate() {
RedisStoreWritingMessageHandler withExternalTemplate = TestUtils.getPropertyValue(context.getBean("withExternalTemplate.adapter"), "handler", RedisStoreWritingMessageHandler.class);
assertEquals("pepboys", ((LiteralExpression) TestUtils.getPropertyValue(withExternalTemplate, "keyExpression")).getExpressionString());
assertEquals("PROPERTIES", (TestUtils.getPropertyValue(withExternalTemplate, "collectionType")).toString());
assertSame(redisTemplate, TestUtils.getPropertyValue(withExternalTemplate, "redisTemplate"));
}
Aggregations