From e2e12980afae52bde8c6bfa98514cf56471f1bdf Mon Sep 17 00:00:00 2001 From: David Syer Date: Wed, 19 May 2010 10:31:05 +0000 Subject: [PATCH] INT-1140: fix bug in the unit test --- .../AggregatorWithMessageStoreParserTests-context.xml | 2 +- .../config/AggregatorWithMessageStoreParserTests.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/config/AggregatorWithMessageStoreParserTests-context.xml b/org.springframework.integration/src/test/java/org/springframework/integration/config/AggregatorWithMessageStoreParserTests-context.xml index b48cac6230..2e3a2eb1ed 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/config/AggregatorWithMessageStoreParserTests-context.xml +++ b/org.springframework.integration/src/test/java/org/springframework/integration/config/AggregatorWithMessageStoreParserTests-context.xml @@ -13,7 +13,7 @@ + input-channel="input" output-channel="output" message-store="messageStore" send-partial-result-on-expiry="true"/> diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/config/AggregatorWithMessageStoreParserTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/config/AggregatorWithMessageStoreParserTests.java index 8706492606..7bdab4e970 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/config/AggregatorWithMessageStoreParserTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/config/AggregatorWithMessageStoreParserTests.java @@ -18,9 +18,6 @@ package org.springframework.integration.config; import static org.junit.Assert.assertEquals; -import java.util.ArrayList; -import java.util.List; - import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -29,6 +26,7 @@ import org.springframework.integration.core.Message; import org.springframework.integration.core.MessageChannel; import org.springframework.integration.message.MessageBuilder; import org.springframework.integration.store.MessageGroupStore; +import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -50,6 +48,7 @@ public class AggregatorWithMessageStoreParserTests { private MessageGroupStore messageGroupStore; @Test + @DirtiesContext public void testAggregation() { input.send(createMessage("123", "id1", 3, 1, null)); @@ -66,6 +65,7 @@ public class AggregatorWithMessageStoreParserTests { @Test + @DirtiesContext public void testExpiry() { input.send(createMessage("123", "id1", 3, 1, null)); @@ -76,7 +76,7 @@ public class AggregatorWithMessageStoreParserTests { assertEquals("One and only one message should have been aggregated", 1, aggregatorBean .getAggregatedMessages().size()); Message aggregatedMessage = aggregatorBean.getAggregatedMessages().get("id1"); - assertEquals("The aggregated message payload is not correct", "123456789", aggregatedMessage + assertEquals("The aggregated message payload is not correct", "123456", aggregatedMessage .getPayload()); }