SubmitObjectsRequestValidator implements Validator<EbXMLSubmitObjectsRequest, ValidationProfile> { @Override public void validate(EbXMLSubmitObjectsRequest request, ValidationProfile profile) { objectContainerValidator.validate(request, profile); }  @Override void validate(EbXMLSubmitObjectsRequest request, ValidationProfile profile);  }
@Test public void testValidateGoodCase() { validator.validate(transformer.toEbXML(request), profile); }
@Test public void testPersonHDMissing() { EbXMLProvideAndRegisterDocumentSetRequest ebXML = transformer.toEbXML(request); ebXML.getExtrinsicObjects().get(0).getClassifications(Vocabulary.DOC_ENTRY_AUTHOR_CLASS_SCHEME).get(0).getSlots().get(0).getValueList().set(0, "lol"); validator.validate(transformer.toEbXML(request), profile); }
@Test public void testAuthorValidation() { request.getSubmissionSet().getAuthors().clear(); EbXMLProvideAndRegisterDocumentSetRequest ebXml = transformer.toEbXML(request); new ObjectContainerValidator().validate(ebXml, profile); Author author = new Author(); author.getAuthorRole().add("clown"); request.getSubmissionSet().setAuthor(author); ebXml = transformer.toEbXML(request); boolean failed = false; try { new ObjectContainerValidator().validate(ebXml, profile); } catch (XDSMetaDataException e) { failed = true; } assertTrue(failed); }