INT-1534 @Header annotations now accept hyphenated header names

This commit is contained in:
Mark Fisher
2010-10-18 10:20:50 -04:00
parent 2f9f92235c
commit a3d14aab9c
2 changed files with 19 additions and 3 deletions

View File

@@ -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() {