@Test
public void addUpdateRelationtest() throws UnsupportedException, ExecutionException {

    UpdateDBObjectBuilder updateDBObjectBuilder = new UpdateDBObjectBuilder();
    Assert.assertEquals("The update query should be empty", new BasicDBObject(), updateDBObjectBuilder.build());
    Relation rel = getBasicRelation(COLUMN_NAME, Operator.ASSIGN, STRING_VALUE);
    updateDBObjectBuilder.addUpdateRelation(rel.getLeftTerm(), rel.getOperator(), rel.getRightTerm());
    BasicDBObject updatedExpected = new BasicDBObject();
    updatedExpected.append("$set", new BasicDBObject(COLUMN_NAME, STRING_VALUE));
    Assert.assertEquals("The update query is not the expected", updatedExpected, updateDBObjectBuilder.build());
    // The following operation should not modify the query
    updateDBObjectBuilder.addUpdateRelation(rel.getLeftTerm(), rel.getOperator(), rel.getRightTerm());
    Assert.assertEquals("The update query is not the expected", updatedExpected, updateDBObjectBuilder.build());
    // The following operation should modify the set
    updateDBObjectBuilder.addUpdateRelation(rel.getLeftTerm(), rel.getOperator(), new StringSelector(
                    STRING_VALUE_OTHER));
    updatedExpected.append("$set", new BasicDBObject(COLUMN_NAME, STRING_VALUE_OTHER));
    Assert.assertEquals("The update query is not the expected", updatedExpected, updateDBObjectBuilder.build());
    Relation rel2 = getBasicRelation(OTHER_COLUMN_NAME, Operator.SUBTRACT, 20l);
    updateDBObjectBuilder.addUpdateRelation(rel2.getLeftTerm(), rel2.getOperator(), rel2.getRightTerm());
    updatedExpected.append("$inc", new BasicDBObject(OTHER_COLUMN_NAME, -20l));
    Assert.assertEquals("The update query is not the expected", updatedExpected, updateDBObjectBuilder.build());
}