From f28f30c880021cf963c3f2b0ee2918ab0d54eec2 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Wed, 11 Sep 2013 17:04:06 +0300 Subject: [PATCH] INT-2117: Test that trim() Works in the AMMR * `AbstractMappingMessageRouter#addChannelFromString` uses `StringUtils.tokenizeToStringArray`, so it's enough to check it from test. JIRA: https://jira.springsource.org/browse/INT-2117 --- .../integration/router/HeaderValueRouter.java | 6 +++--- .../org/springframework/integration/router/RouterTests.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/HeaderValueRouter.java b/spring-integration-core/src/main/java/org/springframework/integration/router/HeaderValueRouter.java index 85ff6f7e24..7c14c415e5 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/HeaderValueRouter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/HeaderValueRouter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ import org.springframework.util.StringUtils; /** * A Message Router that resolves the MessageChannel from a header value. - * + * * @author Oleg Zhurakousky * @author Mark Fisher * @since 1.0.3 @@ -46,7 +46,7 @@ public class HeaderValueRouter extends AbstractMappingMessageRouter { protected List getChannelKeys(Message message) { Object value = message.getHeaders().get(this.headerName); if (value instanceof String && ((String) value).indexOf(',') != -1) { - value = StringUtils.tokenizeToStringArray((String) value, ",", true, true); + value = StringUtils.tokenizeToStringArray((String) value, ","); } return Collections.singletonList(value); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/RouterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/RouterTests.java index 1f6682ef2e..157429eda1 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/RouterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/RouterTests.java @@ -133,7 +133,7 @@ public class RouterTests { AbstractMappingMessageRouter router = new AbstractMappingMessageRouter() { @SuppressWarnings("unchecked") protected List getChannelKeys(Message message) { - return CollectionUtils.arrayToList(new String[] { "testChannel1,testChannel2" }); + return CollectionUtils.arrayToList(new String[] { "testChannel1, , testChannel2 " }); } };