Code example for Map

Methods: get, size

0
    DatabusRequest req = makeRequest();
 
    // Coverage of toString(). 
    String jsonStr = req.toString();
    Map<String, String> jsonMap = _objectMapper.readValue(jsonStr.getBytes(), 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));