INT-1534 @Header annotations now accept hyphenated header names
This commit is contained in:
@@ -296,6 +296,15 @@ public class MethodInvokingMessageProcessorAnnotationTests {
|
||||
assertEquals("DOE, John", result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void fromMessageToHyphenatedHeaderName() throws Exception {
|
||||
Method method = TestService.class.getMethod("headerNameWithHyphen", String.class);
|
||||
MethodInvokingMessageProcessor processor = new MethodInvokingMessageProcessor(testService, method);
|
||||
Message<?> message = MessageBuilder.withPayload("payload").setHeader("foo-bar", "abc").build();
|
||||
Object result = processor.processMessage(message);
|
||||
assertEquals("ABC", result);
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static class MultipleMappingAnnotationTestBean {
|
||||
@@ -386,6 +395,10 @@ public class MethodInvokingMessageProcessorAnnotationTests {
|
||||
public String irrelevantAnnotation(@BogusAnnotation() String value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String headerNameWithHyphen(@Header("foo-bar") String foobar) {
|
||||
return foobar.toUpperCase();
|
||||
}
|
||||
}
|
||||
|
||||
private Message<?> getMessage() {
|
||||
|
||||
Reference in New Issue
Block a user