@SuppressWarnings("boxing")
@Test
public void testDbCommandWithHost() throws Exception {
final String HOST = "7.3.6.5";
final int PORT = 27017;
Mongo mongo = mock(Mongo.class);
ServerAddress address = mock(ServerAddress.class);
when(address.getHost()).thenReturn(HOST);
when(address.getPort()).thenReturn(PORT);
when(mongo.getAddress()).thenReturn(address);
Operation op = assertCommandOperation(new DBDummy(mongo, "testDbCommandWithHost"));
assertEquals("Mismatched host", HOST, op.get("host", String.class));
assertEquals("Mismatched port", 27017, op.getInt("port", (-1)));
}