@Test public void valid_FileFormat() throws Exception { final DocumentValidator schemaValidator = ReferentialDocumentValidators.getValidator(FunctionalAdminCollections.FORMATS); schemaValidator.validateDocument( JsonHandler.getFromInputStream(PropertiesUtils.getResourceAsStream(FILE_FORMAT_OK_JSON_FILE))); }
public static DocumentValidator getValidator(FunctionalAdminCollections collection) { switch (collection) { case RULES: return FILE_RULES_SCHEMA_VALIDATOR; case INGEST_CONTRACT: return INGEST_CONTRACT_SCHEMA_VALIDATOR; case MANAGEMENT_CONTRACT: return MANAGEMENT_CONTRACT_SCHEMA_VALIDATOR; case ACCESS_CONTRACT: return ACCESS_CONTRACT_SCHEMA_VALIDATOR; case PROFILE: return PROFILE_SCHEMA_VALIDATOR; case ARCHIVE_UNIT_PROFILE: return ARCHIVE_UNIT_PROFILE_SCHEMA_VALIDATOR; case AGENCIES: return AGENCIES_SCHEMA_VALIDATOR; case CONTEXT: return CONTEXT_SCHEMA_VALIDATOR; case SECURITY_PROFILE: return SECURITY_PROFILE_SCHEMA_VALIDATOR; case GRIFFIN: return GRIFFIN_SCHEMA; case PRESERVATION_SCENARIO: return PRESERVATION_SCENARIO_SCHEMA; case ONTOLOGY: return ONTOLOGY_SCHEMA_VALIDATOR; case FORMATS: return FILE_FORMAT_SCHEMA_VALIDATOR; case ACCESSION_REGISTER_SUMMARY: return ACCESSION_REGISTER_SUMMARY_SCHEMA_VALIDATOR; case ACCESSION_REGISTER_DETAIL: return ACCESSION_REGISTER_DETAIL_SCHEMA_VALIDATOR; case ACCESSION_REGISTER_SYMBOLIC: return ACCESSION_REGISTER_SYMBOLIC_SCHEMA_VALIDATOR; case VITAM_SEQUENCE: return NULL_SCHEMA_VALIDATOR; default: throw new IllegalStateException("Unexpected value: " + collection); } }
ReferentialDocumentValidators { public static DocumentValidator getValidator(FunctionalAdminCollections collection) { switch (collection) { case RULES: return FILE_RULES_SCHEMA_VALIDATOR; case INGEST_CONTRACT: return INGEST_CONTRACT_SCHEMA_VALIDATOR; case MANAGEMENT_CONTRACT: return MANAGEMENT_CONTRACT_SCHEMA_VALIDATOR; case ACCESS_CONTRACT: return ACCESS_CONTRACT_SCHEMA_VALIDATOR; case PROFILE: return PROFILE_SCHEMA_VALIDATOR; case ARCHIVE_UNIT_PROFILE: return ARCHIVE_UNIT_PROFILE_SCHEMA_VALIDATOR; case AGENCIES: return AGENCIES_SCHEMA_VALIDATOR; case CONTEXT: return CONTEXT_SCHEMA_VALIDATOR; case SECURITY_PROFILE: return SECURITY_PROFILE_SCHEMA_VALIDATOR; case GRIFFIN: return GRIFFIN_SCHEMA; case PRESERVATION_SCENARIO: return PRESERVATION_SCENARIO_SCHEMA; case ONTOLOGY: return ONTOLOGY_SCHEMA_VALIDATOR; case FORMATS: return FILE_FORMAT_SCHEMA_VALIDATOR; case ACCESSION_REGISTER_SUMMARY: return ACCESSION_REGISTER_SUMMARY_SCHEMA_VALIDATOR; case ACCESSION_REGISTER_DETAIL: return ACCESSION_REGISTER_DETAIL_SCHEMA_VALIDATOR; case ACCESSION_REGISTER_SYMBOLIC: return ACCESSION_REGISTER_SYMBOLIC_SCHEMA_VALIDATOR; case VITAM_SEQUENCE: return NULL_SCHEMA_VALIDATOR; default: throw new IllegalStateException("Unexpected value: " + collection); } } }
ReferentialDocumentValidators { public static DocumentValidator getValidator(FunctionalAdminCollections collection) { switch (collection) { case RULES: return FILE_RULES_SCHEMA_VALIDATOR; case INGEST_CONTRACT: return INGEST_CONTRACT_SCHEMA_VALIDATOR; case MANAGEMENT_CONTRACT: return MANAGEMENT_CONTRACT_SCHEMA_VALIDATOR; case ACCESS_CONTRACT: return ACCESS_CONTRACT_SCHEMA_VALIDATOR; case PROFILE: return PROFILE_SCHEMA_VALIDATOR; case ARCHIVE_UNIT_PROFILE: return ARCHIVE_UNIT_PROFILE_SCHEMA_VALIDATOR; case AGENCIES: return AGENCIES_SCHEMA_VALIDATOR; case CONTEXT: return CONTEXT_SCHEMA_VALIDATOR; case SECURITY_PROFILE: return SECURITY_PROFILE_SCHEMA_VALIDATOR; case GRIFFIN: return GRIFFIN_SCHEMA; case PRESERVATION_SCENARIO: return PRESERVATION_SCENARIO_SCHEMA; case ONTOLOGY: return ONTOLOGY_SCHEMA_VALIDATOR; case FORMATS: return FILE_FORMAT_SCHEMA_VALIDATOR; case ACCESSION_REGISTER_SUMMARY: return ACCESSION_REGISTER_SUMMARY_SCHEMA_VALIDATOR; case ACCESSION_REGISTER_DETAIL: return ACCESSION_REGISTER_DETAIL_SCHEMA_VALIDATOR; case ACCESSION_REGISTER_SYMBOLIC: return ACCESSION_REGISTER_SYMBOLIC_SCHEMA_VALIDATOR; case VITAM_SEQUENCE: return NULL_SCHEMA_VALIDATOR; default: throw new IllegalStateException("Unexpected value: " + collection); } }  }
ReferentialDocumentValidators { public static DocumentValidator getValidator(FunctionalAdminCollections collection) { switch (collection) { case RULES: return FILE_RULES_SCHEMA_VALIDATOR; case INGEST_CONTRACT: return INGEST_CONTRACT_SCHEMA_VALIDATOR; case MANAGEMENT_CONTRACT: return MANAGEMENT_CONTRACT_SCHEMA_VALIDATOR; case ACCESS_CONTRACT: return ACCESS_CONTRACT_SCHEMA_VALIDATOR; case PROFILE: return PROFILE_SCHEMA_VALIDATOR; case ARCHIVE_UNIT_PROFILE: return ARCHIVE_UNIT_PROFILE_SCHEMA_VALIDATOR; case AGENCIES: return AGENCIES_SCHEMA_VALIDATOR; case CONTEXT: return CONTEXT_SCHEMA_VALIDATOR; case SECURITY_PROFILE: return SECURITY_PROFILE_SCHEMA_VALIDATOR; case GRIFFIN: return GRIFFIN_SCHEMA; case PRESERVATION_SCENARIO: return PRESERVATION_SCENARIO_SCHEMA; case ONTOLOGY: return ONTOLOGY_SCHEMA_VALIDATOR; case FORMATS: return FILE_FORMAT_SCHEMA_VALIDATOR; case ACCESSION_REGISTER_SUMMARY: return ACCESSION_REGISTER_SUMMARY_SCHEMA_VALIDATOR; case ACCESSION_REGISTER_DETAIL: return ACCESSION_REGISTER_DETAIL_SCHEMA_VALIDATOR; case ACCESSION_REGISTER_SYMBOLIC: return ACCESSION_REGISTER_SYMBOLIC_SCHEMA_VALIDATOR; case VITAM_SEQUENCE: return NULL_SCHEMA_VALIDATOR; default: throw new IllegalStateException("Unexpected value: " + collection); } }  static DocumentValidator getValidator(FunctionalAdminCollections collection); }
ReferentialDocumentValidators { public static DocumentValidator getValidator(FunctionalAdminCollections collection) { switch (collection) { case RULES: return FILE_RULES_SCHEMA_VALIDATOR; case INGEST_CONTRACT: return INGEST_CONTRACT_SCHEMA_VALIDATOR; case MANAGEMENT_CONTRACT: return MANAGEMENT_CONTRACT_SCHEMA_VALIDATOR; case ACCESS_CONTRACT: return ACCESS_CONTRACT_SCHEMA_VALIDATOR; case PROFILE: return PROFILE_SCHEMA_VALIDATOR; case ARCHIVE_UNIT_PROFILE: return ARCHIVE_UNIT_PROFILE_SCHEMA_VALIDATOR; case AGENCIES: return AGENCIES_SCHEMA_VALIDATOR; case CONTEXT: return CONTEXT_SCHEMA_VALIDATOR; case SECURITY_PROFILE: return SECURITY_PROFILE_SCHEMA_VALIDATOR; case GRIFFIN: return GRIFFIN_SCHEMA; case PRESERVATION_SCENARIO: return PRESERVATION_SCENARIO_SCHEMA; case ONTOLOGY: return ONTOLOGY_SCHEMA_VALIDATOR; case FORMATS: return FILE_FORMAT_SCHEMA_VALIDATOR; case ACCESSION_REGISTER_SUMMARY: return ACCESSION_REGISTER_SUMMARY_SCHEMA_VALIDATOR; case ACCESSION_REGISTER_DETAIL: return ACCESSION_REGISTER_DETAIL_SCHEMA_VALIDATOR; case ACCESSION_REGISTER_SYMBOLIC: return ACCESSION_REGISTER_SYMBOLIC_SCHEMA_VALIDATOR; case VITAM_SEQUENCE: return NULL_SCHEMA_VALIDATOR; default: throw new IllegalStateException("Unexpected value: " + collection); } }  static DocumentValidator getValidator(FunctionalAdminCollections collection); static final String ACCESS_CONTRACT_SCHEMA_JSON; static final String ACCESSION_REGISTER_DETAIL_SCHEMA_JSON; static final String ACCESSION_REGISTER_SUMMARY_SCHEMA_JSON; static final String ACCESSION_REGISTER_SYMBOLIC_SCHEMA_JSON; static final String AGENCIES_SCHEMA_JSON; static final String ARCHIVE_UNIT_PROFILE_SCHEMA_JSON; static final String CONTEXT_SCHEMA_JSON; static final String FILE_FORMAT_SCHEMA_JSON; static final String FILE_RULES_SCHEMA_JSON; static final String INGEST_CONTRACT_SCHEMA_JSON; static final String MANAGEMENT_CONTRACT_SCHEMA_JSON; static final String PROFILE_SCHEMA_JSON; static final String SECURITY_PROFILE_SCHEMA_JSON; static final String ONTOLOGY_SCHEMA_JSON; static final String GRIFFIN_SCHEMA_JSON; static final String PRESERVATION_SCENARIO_SCHEMA_JSON; }