@Test
public void shouldUpdateSimpleObject() {
Status thing = Status.Delta;
SubClassPojo pojo = new SubClassPojo();
pojo.setAnIntegerField(44);
pojo.setaLongField(44L);
pojo.setaDoubleField(44.0);
pojo.setStatus(thing);
String extraInfo = "this extra info";
pojo.setExtraProperty(extraInfo);
Monjo<ObjectId, SubClassPojo> monjo = new Monjo<ObjectId, SubClassPojo>(getMongoDB(), SubClassPojo.class, "simplePojo",
new NullCommand<SubClassPojo>());
monjo.removeAll();
ObjectId objectId = monjo.insert(pojo);
SimplePOJO simplePOJO = PojoBuilder.createSimplePojo();
simplePOJO.setId(objectId);
Monjo<ObjectId, SimplePOJO> monjo2 = new Monjo<ObjectId, SimplePOJO>(getMongoDB(), SimplePOJO.class, "simplePojo",
new NullCommand<SimplePOJO>());
monjo2.update(simplePOJO);
SimplePOJO fixture = PojoBuilder.createSimplePojo();
simplePOJO = monjo.findOne(objectId);
assertTrue(fixture.getaDoubleField().equals(simplePOJO.getaDoubleField()));
assertTrue(fixture.getAnIntegerField().equals(simplePOJO.getAnIntegerField()));
assertTrue(fixture.getaLongField().equals(simplePOJO.getaLongField()));
assertTrue(Status.Delta.equals(simplePOJO.getStatus()));
SubClassPojo classPojo = monjo.findOne(objectId);
assertTrue(fixture.getaDoubleField().equals(classPojo.getaDoubleField()));
assertTrue(fixture.getAnIntegerField().equals(classPojo.getAnIntegerField()));
assertTrue(fixture.getaLongField().equals(classPojo.getaLongField()));
assertTrue(Status.Delta.equals(classPojo.getStatus()));
assertTrue(extraInfo.equals(classPojo.getExtraProperty()));
}