INT-1113: fixed with upper bound for grouped messages

This commit is contained in:
David Syer
2010-05-05 15:47:52 +00:00
parent 1f1d35ed5d
commit c8f75e9297
2 changed files with 33 additions and 6 deletions

View File

@@ -56,6 +56,15 @@ public class SimpleMessageStoreTests {
store.addMessage(testMessage2);
}
@Test(expected = MessagingException.class)
public void shouldNotHoldMoreThanGroupCapacity() {
SimpleMessageStore store = new SimpleMessageStore(0, 1);
Message<String> testMessage1 = MessageBuilder.withPayload("foo").build();
Message<String> testMessage2 = MessageBuilder.withPayload("bar").build();
store.addMessageToGroup("foo", testMessage1);
store.addMessageToGroup("foo", testMessage2);
}
@Test
public void shouldHoldCapacityExactly() {
SimpleMessageStore store = new SimpleMessageStore(2);