Skip to content

Instantly share code, notes, and snippets.

@trishagee
Created December 20, 2013 15:13
Show Gist options
  • Save trishagee/8056136 to your computer and use it in GitHub Desktop.
Save trishagee/8056136 to your computer and use it in GitHub Desktop.
@Test
public void testGetLastErrorCommand() {
assertEquals(new BasicDBObject("getlasterror", 1), WriteConcern.UNACKNOWLEDGED.getCommand());
assertEquals(new BasicDBObject("getlasterror", 1), WriteConcern.ACKNOWLEDGED.getCommand());
assertEquals(new BasicDBObject("getlasterror", 1).append("w", 2), WriteConcern.REPLICA_ACKNOWLEDGED.getCommand());
assertEquals(new BasicDBObject("getlasterror", 1).append("j", true), WriteConcern.JOURNALED.getCommand());
assertEquals(new BasicDBObject("getlasterror", 1).append("fsync", true), WriteConcern.FSYNCED.getCommand());
assertEquals(new BasicDBObject("getlasterror", 1).append("w", "majority"), new WriteConcern("majority").getCommand());
assertEquals(new BasicDBObject("getlasterror", 1).append("wtimeout", 100), new WriteConcern(1, 100).getCommand());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment