INT-988 Added ignored test case. To reproduce bug:

- remove @Ignore
  - put breakpoint in PropertyOrFieldReference (line 167)
  - step through
This commit is contained in:
Iwein Fuld
2010-09-10 13:47:28 +02:00
parent b0a54a813d
commit 97ca31d68d

View File

@@ -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<String>("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<String> messageWithHeader = MessageBuilder.withPayload("foo")
.setHeader("num", new Integer(123)).build();
GenericMessage<String> messageWithoutHeader = new GenericMessage<String>("foo");
processor.processMessage(messageWithHeader);
processor.processMessage(messageWithoutHeader);
}
@Test
public void fromMessageWithRequiredHeaderProvided() throws Exception {
Method method = TestService.class.getMethod("requiredHeader", Integer.class);