AlterOptionsUtils { public static DBObject buildRenameColumnDBObject(String oldName, String newName) { return new BasicDBObject(RENAME_COMMAND, new BasicDBObject(oldName, newName)); } 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 renameColumnTest() { BasicDBObject expected = new BasicDBObject("$rename", new BasicDBObject("old", "new")); Assert.assertEquals("The command is not the expected", expected, AlterOptionsUtils.buildRenameColumnDBObject("old", "new")); }