Search in sources :

Example 1 with RedisProperties

use of org.springframework.data.redis.support.collections.RedisProperties in project spring-integration by spring-projects.

the class RedisStoreOutboundChannelAdapterIntegrationTests method testPropertiesSimple.

@Test
@RedisAvailable
public void testPropertiesSimple() {
    RedisProperties redisProperties = new RedisProperties("foo", this.redisTemplate);
    assertEquals(0, redisProperties.size());
    Message<String> message = MessageBuilder.withPayload("bar").setHeader(RedisHeaders.KEY, "foo").setHeader("baz", "qux").build();
    this.simplePropertyChannel.send(message);
    assertEquals("bar", redisProperties.get("qux"));
}
Also used : RedisProperties(org.springframework.data.redis.support.collections.RedisProperties) RedisAvailable(org.springframework.integration.redis.rules.RedisAvailable) Test(org.junit.Test)

Example 2 with RedisProperties

use of org.springframework.data.redis.support.collections.RedisProperties in project spring-integration by spring-projects.

the class RedisStoreOutboundChannelAdapterIntegrationTests method testProperties.

@Test
@RedisAvailable
public void testProperties() {
    RedisProperties redisProperties = new RedisProperties("pepboys", this.redisTemplate);
    assertEquals(0, redisProperties.size());
    Properties pepboys = new Properties();
    pepboys.put("1", "Manny");
    pepboys.put("2", "Moe");
    pepboys.put("3", "Jack");
    Message<Properties> message = MessageBuilder.withPayload(pepboys).build();
    this.propertyChannel.send(message);
    assertEquals("Manny", redisProperties.get("1"));
    assertEquals("Moe", redisProperties.get("2"));
    assertEquals("Jack", redisProperties.get("3"));
}
Also used : RedisProperties(org.springframework.data.redis.support.collections.RedisProperties) RedisProperties(org.springframework.data.redis.support.collections.RedisProperties) Properties(java.util.Properties) RedisAvailable(org.springframework.integration.redis.rules.RedisAvailable) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 RedisProperties (org.springframework.data.redis.support.collections.RedisProperties)2 RedisAvailable (org.springframework.integration.redis.rules.RedisAvailable)2 Properties (java.util.Properties)1