@Test public void testExtractFieldsFromSchema() throws Exception { JsonNode jsonArcUnit = JsonHandler.getFromInputStream(PropertiesUtils.getResourceAsStream(ARCHIVE_UNIT_PROFILE_OK_JSON_FILE)); ArchiveUnitProfileModel archiveUnitProfile = JsonHandler.getFromJsonNode(jsonArcUnit, ArchiveUnitProfileModel.class); List<String> extractFields = SchemaValidationUtils.extractFieldsFromSchema(archiveUnitProfile.getControlSchema()); assertEquals(extractFields.size(), 14); assertTrue(extractFields.contains("Rule")); assertTrue(extractFields.contains("StartDate")); assertTrue(extractFields.contains("PreventRulesId")); assertFalse(extractFields.contains("Rules")); assertFalse(extractFields.contains("#management")); }
public static List<String> extractFieldsFromSchema(String schemaJsonAsString) throws InvalidParseOperationException { List<String> listProperties = new ArrayList<>(); JsonNode externalSchema = JsonHandler.getFromString(schemaJsonAsString); if (externalSchema != null && externalSchema.get(PROPERTIES) != null) { extractPropertyFromJsonNode(externalSchema.get(PROPERTIES), listProperties); } return listProperties; }
SchemaValidationUtils { public static List<String> extractFieldsFromSchema(String schemaJsonAsString) throws InvalidParseOperationException { List<String> listProperties = new ArrayList<>(); JsonNode externalSchema = JsonHandler.getFromString(schemaJsonAsString); if (externalSchema != null && externalSchema.get(PROPERTIES) != null) { extractPropertyFromJsonNode(externalSchema.get(PROPERTIES), listProperties); } return listProperties; } }
SchemaValidationUtils { public static List<String> extractFieldsFromSchema(String schemaJsonAsString) throws InvalidParseOperationException { List<String> listProperties = new ArrayList<>(); JsonNode externalSchema = JsonHandler.getFromString(schemaJsonAsString); if (externalSchema != null && externalSchema.get(PROPERTIES) != null) { extractPropertyFromJsonNode(externalSchema.get(PROPERTIES), listProperties); } return listProperties; }  }
SchemaValidationUtils { public static List<String> extractFieldsFromSchema(String schemaJsonAsString) throws InvalidParseOperationException { List<String> listProperties = new ArrayList<>(); JsonNode externalSchema = JsonHandler.getFromString(schemaJsonAsString); if (externalSchema != null && externalSchema.get(PROPERTIES) != null) { extractPropertyFromJsonNode(externalSchema.get(PROPERTIES), listProperties); } return listProperties; }  static List<String> extractFieldsFromSchema(String schemaJsonAsString); }
SchemaValidationUtils { public static List<String> extractFieldsFromSchema(String schemaJsonAsString) throws InvalidParseOperationException { List<String> listProperties = new ArrayList<>(); JsonNode externalSchema = JsonHandler.getFromString(schemaJsonAsString); if (externalSchema != null && externalSchema.get(PROPERTIES) != null) { extractPropertyFromJsonNode(externalSchema.get(PROPERTIES), listProperties); } return listProperties; }  static List<String> extractFieldsFromSchema(String schemaJsonAsString);  }