@Test public void testWithPolicyAndOriginalFile() throws Exception { RemoteDocument signedFile = RemoteDocumentConverter.toRemoteDocument(new FileDocument("src/test/resources/xades-detached.xml")); RemoteDocument originalFile = RemoteDocumentConverter.toRemoteDocument(new FileDocument("src/test/resources/sample.png")); RemoteDocument policy = RemoteDocumentConverter.toRemoteDocument(new FileDocument("src/test/resources/constraint.xml")); DataToValidateDTO dto = new DataToValidateDTO(signedFile, originalFile, policy); WSReportsDTO result = validationService.validateDocument(dto); validateReports(result); }
public WSReportsDTO validateDocument(DataToValidateDTO dataToValidate) { LOG.info("ValidateDocument in process..."); SignedDocumentValidator validator = initValidator(dataToValidate); Reports reports = null; RemoteDocument policy = dataToValidate.getPolicy(); if (policy == null) { reports = validator.validateDocument(); } else { reports = validator.validateDocument(getValidationPolicy(policy)); } WSReportsDTO reportsDTO = new WSReportsDTO(reports.getDiagnosticDataJaxb(), reports.getSimpleReportJaxb(), reports.getDetailedReportJaxb(), reports.getEtsiValidationReportJaxb()); LOG.info("ValidateDocument is finished"); return reportsDTO; }
RemoteDocumentValidationService { public WSReportsDTO validateDocument(DataToValidateDTO dataToValidate) { LOG.info("ValidateDocument in process..."); SignedDocumentValidator validator = initValidator(dataToValidate); Reports reports = null; RemoteDocument policy = dataToValidate.getPolicy(); if (policy == null) { reports = validator.validateDocument(); } else { reports = validator.validateDocument(getValidationPolicy(policy)); } WSReportsDTO reportsDTO = new WSReportsDTO(reports.getDiagnosticDataJaxb(), reports.getSimpleReportJaxb(), reports.getDetailedReportJaxb(), reports.getEtsiValidationReportJaxb()); LOG.info("ValidateDocument is finished"); return reportsDTO; } }
RemoteDocumentValidationService { public WSReportsDTO validateDocument(DataToValidateDTO dataToValidate) { LOG.info("ValidateDocument in process..."); SignedDocumentValidator validator = initValidator(dataToValidate); Reports reports = null; RemoteDocument policy = dataToValidate.getPolicy(); if (policy == null) { reports = validator.validateDocument(); } else { reports = validator.validateDocument(getValidationPolicy(policy)); } WSReportsDTO reportsDTO = new WSReportsDTO(reports.getDiagnosticDataJaxb(), reports.getSimpleReportJaxb(), reports.getDetailedReportJaxb(), reports.getEtsiValidationReportJaxb()); LOG.info("ValidateDocument is finished"); return reportsDTO; }  }
RemoteDocumentValidationService { public WSReportsDTO validateDocument(DataToValidateDTO dataToValidate) { LOG.info("ValidateDocument in process..."); SignedDocumentValidator validator = initValidator(dataToValidate); Reports reports = null; RemoteDocument policy = dataToValidate.getPolicy(); if (policy == null) { reports = validator.validateDocument(); } else { reports = validator.validateDocument(getValidationPolicy(policy)); } WSReportsDTO reportsDTO = new WSReportsDTO(reports.getDiagnosticDataJaxb(), reports.getSimpleReportJaxb(), reports.getDetailedReportJaxb(), reports.getEtsiValidationReportJaxb()); LOG.info("ValidateDocument is finished"); return reportsDTO; }  void setVerifier(CertificateVerifier verifier); WSReportsDTO validateDocument(DataToValidateDTO dataToValidate); List<RemoteDocument> getOriginalDocuments(DataToValidateDTO dataToValidate); }
RemoteDocumentValidationService { public WSReportsDTO validateDocument(DataToValidateDTO dataToValidate) { LOG.info("ValidateDocument in process..."); SignedDocumentValidator validator = initValidator(dataToValidate); Reports reports = null; RemoteDocument policy = dataToValidate.getPolicy(); if (policy == null) { reports = validator.validateDocument(); } else { reports = validator.validateDocument(getValidationPolicy(policy)); } WSReportsDTO reportsDTO = new WSReportsDTO(reports.getDiagnosticDataJaxb(), reports.getSimpleReportJaxb(), reports.getDetailedReportJaxb(), reports.getEtsiValidationReportJaxb()); LOG.info("ValidateDocument is finished"); return reportsDTO; }  void setVerifier(CertificateVerifier verifier); WSReportsDTO validateDocument(DataToValidateDTO dataToValidate); List<RemoteDocument> getOriginalDocuments(DataToValidateDTO dataToValidate);  }