@Test public void testBuildJsonNull() throws UnknownHostException { ObjectNode expectedNode = JsonObject.getFactory().objectNode(); expectedNode.put("modifiedCount", 0L); expectedNode.put("matchCount", 0L); expectedNode.put("hostname", InetAddress.getLocalHost().getHostName()); expectedNode.put("status","COMPLETE"); assertTrue(response.toJson().equals(expectedNode)); }
@Override public JsonNode toJson() { ObjectNode node=(ObjectNode)super.toJson(); if(entityData!=null) { node.set(PROPERTY_PROCESSED, entityData); } if(resultMetadata!=null) { ArrayNode arr=jsonNodeFactory.arrayNode(); for(ResultMetadata x:resultMetadata) { arr.add(x==null?jsonNodeFactory.nullNode():x.toJson()); } node.set(PROPERTY_RESULT_METADATA,arr); } return node; }
Response extends BaseResponse { @Override public JsonNode toJson() { ObjectNode node=(ObjectNode)super.toJson(); if(entityData!=null) { node.set(PROPERTY_PROCESSED, entityData); } if(resultMetadata!=null) { ArrayNode arr=jsonNodeFactory.arrayNode(); for(ResultMetadata x:resultMetadata) { arr.add(x==null?jsonNodeFactory.nullNode():x.toJson()); } node.set(PROPERTY_RESULT_METADATA,arr); } return node; } }
Response extends BaseResponse { @Override public JsonNode toJson() { ObjectNode node=(ObjectNode)super.toJson(); if(entityData!=null) { node.set(PROPERTY_PROCESSED, entityData); } if(resultMetadata!=null) { ArrayNode arr=jsonNodeFactory.arrayNode(); for(ResultMetadata x:resultMetadata) { arr.add(x==null?jsonNodeFactory.nullNode():x.toJson()); } node.set(PROPERTY_RESULT_METADATA,arr); } return node; } Response(JsonNodeFactory jsonNodeFactory, OperationStatus status);  Response(Response r);  Response(BaseResponse r); }
Response extends BaseResponse { @Override public JsonNode toJson() { ObjectNode node=(ObjectNode)super.toJson(); if(entityData!=null) { node.set(PROPERTY_PROCESSED, entityData); } if(resultMetadata!=null) { ArrayNode arr=jsonNodeFactory.arrayNode(); for(ResultMetadata x:resultMetadata) { arr.add(x==null?jsonNodeFactory.nullNode():x.toJson()); } node.set(PROPERTY_RESULT_METADATA,arr); } return node; } Response(JsonNodeFactory jsonNodeFactory, OperationStatus status);  Response(Response r);  Response(BaseResponse r); void setResultSizeThresholds(int maxResultSetSizeB, int warnResultSetSizeB, final Request forRequest); JsonNode getEntityData(); void setEntityData(JsonNode node); void addEntityData(JsonNode doc); List<ResultMetadata> getResultMetadata(); void setResultMetadata(List<ResultMetadata> l); @Override JsonNode toJson(); int getResponseDataSizeB(); }
Response extends BaseResponse { @Override public JsonNode toJson() { ObjectNode node=(ObjectNode)super.toJson(); if(entityData!=null) { node.set(PROPERTY_PROCESSED, entityData); } if(resultMetadata!=null) { ArrayNode arr=jsonNodeFactory.arrayNode(); for(ResultMetadata x:resultMetadata) { arr.add(x==null?jsonNodeFactory.nullNode():x.toJson()); } node.set(PROPERTY_RESULT_METADATA,arr); } return node; } Response(JsonNodeFactory jsonNodeFactory, OperationStatus status);  Response(Response r);  Response(BaseResponse r); void setResultSizeThresholds(int maxResultSetSizeB, int warnResultSetSizeB, final Request forRequest); JsonNode getEntityData(); void setEntityData(JsonNode node); void addEntityData(JsonNode doc); List<ResultMetadata> getResultMetadata(); void setResultMetadata(List<ResultMetadata> l); @Override JsonNode toJson(); int getResponseDataSizeB(); static final String ERR_RESULT_SIZE_TOO_LARGE; }