removeAttachment on org.switchyard.bus.camel.CamelMessage leads to an java.lang.StackOverflowError
Issue
Following test:
public class CamelMessageTest {
private static final String TESTDATASOURCE_NAME = "testdatasource";
private static final String TEST_ATTACHMENT_ID = "testId";
@Rule public ExpectedException expected = ExpectedException.none();
@Test
public void testRemoveAttachment() throws Exception {
CamelMessage message = new CamelMessage(new DefaultExchange(new SwitchYardCamelContextImpl(false)));
Assert.assertThat(message.getAttachment(TEST_ATTACHMENT_ID), IsNull.nullValue());
message.addAttachment(TEST_ATTACHMENT_ID, new TestDataSource(TESTDATASOURCE_NAME));
Assert.assertThat(message.getAttachment(TEST_ATTACHMENT_ID), IsNull.notNullValue());
Assert.assertThat(message.getAttachment(TEST_ATTACHMENT_ID).getName(), Is.is(TESTDATASOURCE_NAME));
message.removeAttachment(TEST_ATTACHMENT_ID);
Assert.assertThat(message.getAttachment(TEST_ATTACHMENT_ID), IsNull.nullValue());
}
}
Ends in StackOverflowException
Environment
- Red Hat JBoss Fuse 6.2.1
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.