INT-4023: Fix MongoDB MGSs timing issue

JIRA: https://jira.spring.io/browse/INT-4023

There is no guaranty that following `System.currentTimeMillis()` return the same value.
That is how the `assertEquals()` test for `created` and `modified` value may fail sporadically.

* Fix `MongoDbMessageStore` and `ConfigurableMongoDbMessageStore` do not use a new `System.currentTimeMillis()`
in case of `group create`

**Cherry-pick to 4.2.x**
This commit is contained in:
Artem Bilan
2016-05-06 07:38:08 -04:00
parent 10a6abf688
commit 806bec33f1
3 changed files with 7 additions and 7 deletions

View File

@@ -235,7 +235,7 @@ public abstract class AbstractMongoDbMessageGroupStoreTests extends MongoDbAvail
long createdTimestamp = messageGroup.getTimestamp();
long updatedTimestamp = messageGroup.getLastModified();
assertEquals(createdTimestamp, updatedTimestamp);
Thread.sleep(1000);
Thread.sleep(10);
message = new GenericMessage<String>("Hello again");
messageGroup = store.addMessageToGroup(1, message);
createdTimestamp = messageGroup.getTimestamp();