AlterOptionsUtils { public static DBObject buildDropColumnDBObject(String name) { return new BasicDBObject(DROP_COMMAND, new BasicDBObject(name, "")); } private  AlterOptionsUtils(); static DBObject buildRenameColumnDBObject(String oldName, String newName); static DBObject buildDropColumnDBObject(String name); static final String RENAME_COMMAND; static final String DROP_COMMAND; }
@Test public void dropColumnTest() { BasicDBObject expected = new BasicDBObject("$unset", new BasicDBObject("column", "")); Assert.assertEquals("The command is not the expected", expected, AlterOptionsUtils.buildDropColumnDBObject("column")); }