@Test
public void shouldUpdateApplicationMessage() throws Exception {
DBCollection col = db.getCollection(MongoMessageStore.APPLICATIONS_MSGS);
String id = createMessageForUpdate(col);
MongoMessageStore store = new MongoMessageStore();
store.setMongo(db);
Message message = new Message();
message.setId(id.toString());
message.setDirection(Direction.TO_APPLICATIONS);
message.setSource("source");
message.setDestination("destination");
message.setReference("54321");
message.setModificationTime(new Date());
message.setProperty("to", "3002222222");
message.setProperty("from", "2453");
message.setProperty("text", "this is a test");
store.saveOrUpdate(message);
BasicDBObject obj = (BasicDBObject) col.findOne();
Assert.assertNotNull(obj);
Assert.assertEquals( (byte) obj.getInt("status"), Message.STATUS_CREATED );