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
This commit is contained in:
committed by
Gary Russell
parent
5cb64f81f6
commit
f28f30c880
@@ -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<Object> 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);
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ public class RouterTests {
|
||||
AbstractMappingMessageRouter router = new AbstractMappingMessageRouter() {
|
||||
@SuppressWarnings("unchecked")
|
||||
protected List<Object> getChannelKeys(Message<?> message) {
|
||||
return CollectionUtils.arrayToList(new String[] { "testChannel1,testChannel2" });
|
||||
return CollectionUtils.arrayToList(new String[] { "testChannel1, , testChannel2 " });
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user