@Test
public void testToString() throws Exception
{

  DatabusRequest req = makeRequest();
  // Coverage of toString().
  String jsonStr = req.toString();
  Map<String, String> jsonMap = _objectMapper.readValue(jsonStr.getBytes(Charset.defaultCharset()), new TypeReference<Map<String, String>>() {});
  Assert.assertEquals(reqName, jsonMap.get("name"));
  Assert.assertEquals(method.toString(), jsonMap.get("method"));
  Assert.assertEquals(propval1, jsonMap.get(prop1));
  Assert.assertEquals(propval2, jsonMap.get(prop2));
  Assert.assertEquals(4, jsonMap.size());
  // Coverage for null processor.
  Assert.assertEquals(req, req.call());
  // Coverqage for setCursorPartition
  PhysicalPartition pp = new PhysicalPartition(15, "SomePartition");
  req.setCursorPartition(pp);
  Assert.assertEquals(pp, req.getCursorPartition());
  Assert.assertFalse(req.cancel(true));
  Assert.assertFalse(req.cancel(false));
  Assert.assertEquals(req, req.get());
  Assert.assertEquals(req, req.get(89L, TimeUnit.HOURS));
  Assert.assertFalse(req.isCancelled());
  InetSocketAddress remoteAddress = (InetSocketAddress)req.getRemoteAddress();
  Assert.assertEquals(port, remoteAddress.getPort());
  Assert.assertEquals(InetAddress.getByAddress(ipAddr), remoteAddress.getAddress());
}