@Test public void testWithErrors() { ObjectNode objNode = JsonObject.getFactory().objectNode(); ArrayNode arr = JsonObject.getFactory().arrayNode(); for (Error err : getPopulatedErrors(3)) { arr.add(err.toJson()); } objNode.set("errors", arr); builder.withErrors(arr); for (int i = 0; i < builder.buildResponse().getErrors().size(); i++) { Error e = builder.buildResponse().getErrors().get(i); assertTrue(e.getErrorCode().equals(getPopulatedErrors(3).get(i).getErrorCode())); } }
@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; }