Source:
public void testProducerProperties() throws Exception { Binder<MessageChannel> binder = getBinder(); Binding<MessageChannel> consumerBinding = binder.bindConsumer("props.0", "test", new DirectChannel(), null); Binding<MessageChannel> producerBinding = binder.bindProducer("props.0", new DirectChannel(), null); AbstractEndpoint endpoint = extractEndpoint(producerBinding); @SuppressWarnings("unchecked") Map<String, RedisQueueOutboundChannelAdapter> adapters = TestUtils.getPropertyValue(endpoint, "handler.adapters", Map.class); RedisQueueOutboundChannelAdapter adapter = adapters.get("test"); assertEquals( "props.0.test", TestUtils.getPropertyValue(adapter, "queueNameExpression", Expression.class).getExpressionString()); producerBinding.unbind(); assertFalse(endpoint.isRunning()); Properties properties = new Properties(); properties.put("partitionKeyExpression", "'foo'"); properties.put("partitionKeyExtractorClass", "foo"); properties.put("partitionSelectorExpression", "0"); properties.put("partitionSelectorClass", "foo"); properties.put(BinderPropertyKeys.NEXT_MODULE_COUNT, "1"); producerBinding = binder.bindProducer("props.0", new DirectChannel(), properties); endpoint = extractEndpoint(producerBinding); adapter = (RedisQueueOutboundChannelAdapter) TestUtils.getPropertyValue(endpoint, "handler.adapters", Map.class).get("test"); assertEquals( "'props.0.test-' + headers['partition']", TestUtils.getPropertyValue(adapter, "queueNameExpression", Expression.class).getExpressionString()); producerBinding.unbind(); consumerBinding.unbind(); assertFalse(extractEndpoint(producerBinding).isRunning()); assertFalse(extractEndpoint(consumerBinding).isRunning()); }

Target:
public void testProducerProperties() throws Exception { Binder<MessageChannel> binder = getBinder(); Binding<MessageChannel> consumerBinding = binder.bindConsumer("props.0", "test", new DirectChannel(), null); Binding<MessageChannel> producerBinding = binder.bindProducer("props.0", new DirectChannel(), null); AbstractEndpoint producerEndpoint = extractEndpoint(producerBinding); @SuppressWarnings("unchecked") Map<String, RedisQueueOutboundChannelAdapter> adapters = TestUtils.getPropertyValue(producerEndpoint, "handler.adapters", Map.class); RedisQueueOutboundChannelAdapter adapter = adapters.get("test"); assertEquals( "props.0.test", TestUtils.getPropertyValue(adapter, "queueNameExpression", Expression.class).getExpressionString()); producerBinding.unbind(); assertFalse(producerEndpoint.isRunning()); Properties properties = new Properties(); properties.put("partitionKeyExpression", "'foo'"); properties.put("partitionKeyExtractorClass", "foo"); properties.put("partitionSelectorExpression", "0"); properties.put("partitionSelectorClass", "foo"); properties.put(BinderPropertyKeys.NEXT_MODULE_COUNT, "1"); producerBinding = binder.bindProducer("props.0", new DirectChannel(), properties); producerEndpoint = extractEndpoint(producerBinding); adapter = (RedisQueueOutboundChannelAdapter) TestUtils.getPropertyValue(producerEndpoint, "handler.adapters", Map.class).get("test"); assertEquals( "'props.0.test-' + headers['partition']", TestUtils.getPropertyValue(adapter, "queueNameExpression", Expression.class).getExpressionString()); producerBinding.unbind(); consumerBinding.unbind(); assertFalse(producerEndpoint.isRunning()); assertFalse(extractEndpoint(consumerBinding).isRunning()); }