@Test public void parseReclassificationRequest_emptyQuery() throws Exception { JsonNode jsonRequest = JsonHandler.getFromInputStream( PropertiesUtils.getResourceAsStream("Reclassification/dsl_parsing/reclassification_query_empty.json")); ReclassificationRequestDslParser instance = new ReclassificationRequestDslParser(); assertThatThrownBy(() -> instance.parseReclassificationRequest(jsonRequest)) .isInstanceOf(InvalidParseOperationException.class); }
public ParsedReclassificationDslRequest parseReclassificationRequest(JsonNode reclassificationDslJson) throws InvalidParseOperationException { if (!reclassificationDslJson.isArray() || reclassificationDslJson.size() == 0) { throw new InvalidParseOperationException("Expected array of reclassification updates DSLs"); } List<ParsedReclassificationDslRequestEntry> entries = new ArrayList<>(); for (JsonNode singleReclassificationDslJson : reclassificationDslJson) { SelectMultiQuery selectMultiQuery = parseSelectMultiQuery(singleReclassificationDslJson); Set<String> attachments = parseReclassificationDslAttachments(singleReclassificationDslJson); Set<String> detachments = parseReclassificationDslDetachments(singleReclassificationDslJson); entries.add(new ParsedReclassificationDslRequestEntry( selectMultiQuery, attachments, detachments)); } return new ParsedReclassificationDslRequest(entries); }
ReclassificationRequestDslParser { public ParsedReclassificationDslRequest parseReclassificationRequest(JsonNode reclassificationDslJson) throws InvalidParseOperationException { if (!reclassificationDslJson.isArray() || reclassificationDslJson.size() == 0) { throw new InvalidParseOperationException("Expected array of reclassification updates DSLs"); } List<ParsedReclassificationDslRequestEntry> entries = new ArrayList<>(); for (JsonNode singleReclassificationDslJson : reclassificationDslJson) { SelectMultiQuery selectMultiQuery = parseSelectMultiQuery(singleReclassificationDslJson); Set<String> attachments = parseReclassificationDslAttachments(singleReclassificationDslJson); Set<String> detachments = parseReclassificationDslDetachments(singleReclassificationDslJson); entries.add(new ParsedReclassificationDslRequestEntry( selectMultiQuery, attachments, detachments)); } return new ParsedReclassificationDslRequest(entries); } }
ReclassificationRequestDslParser { public ParsedReclassificationDslRequest parseReclassificationRequest(JsonNode reclassificationDslJson) throws InvalidParseOperationException { if (!reclassificationDslJson.isArray() || reclassificationDslJson.size() == 0) { throw new InvalidParseOperationException("Expected array of reclassification updates DSLs"); } List<ParsedReclassificationDslRequestEntry> entries = new ArrayList<>(); for (JsonNode singleReclassificationDslJson : reclassificationDslJson) { SelectMultiQuery selectMultiQuery = parseSelectMultiQuery(singleReclassificationDslJson); Set<String> attachments = parseReclassificationDslAttachments(singleReclassificationDslJson); Set<String> detachments = parseReclassificationDslDetachments(singleReclassificationDslJson); entries.add(new ParsedReclassificationDslRequestEntry( selectMultiQuery, attachments, detachments)); } return new ParsedReclassificationDslRequest(entries); }  }
ReclassificationRequestDslParser { public ParsedReclassificationDslRequest parseReclassificationRequest(JsonNode reclassificationDslJson) throws InvalidParseOperationException { if (!reclassificationDslJson.isArray() || reclassificationDslJson.size() == 0) { throw new InvalidParseOperationException("Expected array of reclassification updates DSLs"); } List<ParsedReclassificationDslRequestEntry> entries = new ArrayList<>(); for (JsonNode singleReclassificationDslJson : reclassificationDslJson) { SelectMultiQuery selectMultiQuery = parseSelectMultiQuery(singleReclassificationDslJson); Set<String> attachments = parseReclassificationDslAttachments(singleReclassificationDslJson); Set<String> detachments = parseReclassificationDslDetachments(singleReclassificationDslJson); entries.add(new ParsedReclassificationDslRequestEntry( selectMultiQuery, attachments, detachments)); } return new ParsedReclassificationDslRequest(entries); }  ParsedReclassificationDslRequest parseReclassificationRequest(JsonNode reclassificationDslJson); }
ReclassificationRequestDslParser { public ParsedReclassificationDslRequest parseReclassificationRequest(JsonNode reclassificationDslJson) throws InvalidParseOperationException { if (!reclassificationDslJson.isArray() || reclassificationDslJson.size() == 0) { throw new InvalidParseOperationException("Expected array of reclassification updates DSLs"); } List<ParsedReclassificationDslRequestEntry> entries = new ArrayList<>(); for (JsonNode singleReclassificationDslJson : reclassificationDslJson) { SelectMultiQuery selectMultiQuery = parseSelectMultiQuery(singleReclassificationDslJson); Set<String> attachments = parseReclassificationDslAttachments(singleReclassificationDslJson); Set<String> detachments = parseReclassificationDslDetachments(singleReclassificationDslJson); entries.add(new ParsedReclassificationDslRequestEntry( selectMultiQuery, attachments, detachments)); } return new ParsedReclassificationDslRequest(entries); }  ParsedReclassificationDslRequest parseReclassificationRequest(JsonNode reclassificationDslJson);  }