Assert.assertEquals( 0, messageGroup.size() );
}
@Test
public void testUpdatedDateChangesWithEachAddedMessage() throws InterruptedException {
MessageGroup messageGroup = store.getMessageGroup( 1 );
Message<?> message = new GenericMessage<String>( "Hello" );
messageGroup = store.addMessageToGroup( 1, message );
Assert.assertEquals( 1, messageGroup.size() );
long createdTimestamp = messageGroup.getTimestamp();
long updatedTimestamp = messageGroup.getLastModified();
Assert.assertEquals( createdTimestamp, updatedTimestamp );
Thread.sleep( 1000 );
message = new GenericMessage<String>( "Hello" );
messageGroup = store.addMessageToGroup( 1, message );
createdTimestamp = messageGroup.getTimestamp();
updatedTimestamp = messageGroup.getLastModified();
Assert.assertTrue( updatedTimestamp > createdTimestamp );
// use another message store instance
VoldemortMessageStore newStore = createNewStoreClient();
messageGroup = newStore.getMessageGroup( 1 );
Assert.assertEquals( 2, messageGroup.size() );
}