From 97ca31d68d654e713c10f5bdb69d069e8537da7f Mon Sep 17 00:00:00 2001 From: Iwein Fuld Date: Fri, 10 Sep 2010 13:47:28 +0200 Subject: [PATCH] INT-988 Added ignored test case. To reproduce bug: - remove @Ignore - put breakpoint in PropertyOrFieldReference (line 167) - step through --- ...vokingMessageProcessorAnnotationTests.java | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/MethodInvokingMessageProcessorAnnotationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/MethodInvokingMessageProcessorAnnotationTests.java index 266ed00990..d44d352509 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/MethodInvokingMessageProcessorAnnotationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/MethodInvokingMessageProcessorAnnotationTests.java @@ -16,18 +16,9 @@ package org.springframework.integration.handler; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; - import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; - import org.springframework.integration.Message; import org.springframework.integration.MessageHandlingException; import org.springframework.integration.MessageHeaders; @@ -38,6 +29,13 @@ import org.springframework.integration.annotation.Payload; import org.springframework.integration.message.GenericMessage; import org.springframework.integration.support.MessageBuilder; +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +import static org.junit.Assert.*; + /** * @author Mark Fisher * @author Iwein Fuld @@ -65,6 +63,19 @@ public class MethodInvokingMessageProcessorAnnotationTests { processor.processMessage(new GenericMessage("foo")); } + @Ignore //see INT-988 + @Test(expected = MessageHandlingException.class) + public void requiredHeaderNotProvidedOnSecondMessage() throws Exception { + Method method = TestService.class.getMethod("requiredHeader", Integer.class); + MethodInvokingMessageProcessor processor = new MethodInvokingMessageProcessor(testService, method); + Message messageWithHeader = MessageBuilder.withPayload("foo") + .setHeader("num", new Integer(123)).build(); + GenericMessage messageWithoutHeader = new GenericMessage("foo"); + + processor.processMessage(messageWithHeader); + processor.processMessage(messageWithoutHeader); + } + @Test public void fromMessageWithRequiredHeaderProvided() throws Exception { Method method = TestService.class.getMethod("requiredHeader", Integer.class);