@Test public void reportWithEmptySignaturesReturnsNa() { assertEquals(NA, resolveSignatureType(new ValidationConclusion())); }
static String resolveSignatureType(ValidationConclusion validationConclusion) { if (CollectionUtils.isEmpty(validationConclusion.getSignatures()) || isTstTypeContainer(validationConclusion)) { return NA; } String signatureFormat = validationConclusion.getSignatures().get(0).getSignatureFormat(); if (isDdoc(signatureFormat) || isXades(signatureFormat)) { return XADES; } if (isCades(signatureFormat)) { return CADES; } if (isPades(signatureFormat)) { return PADES; } return NA; }
SignatureTypeResolver { static String resolveSignatureType(ValidationConclusion validationConclusion) { if (CollectionUtils.isEmpty(validationConclusion.getSignatures()) || isTstTypeContainer(validationConclusion)) { return NA; } String signatureFormat = validationConclusion.getSignatures().get(0).getSignatureFormat(); if (isDdoc(signatureFormat) || isXades(signatureFormat)) { return XADES; } if (isCades(signatureFormat)) { return CADES; } if (isPades(signatureFormat)) { return PADES; } return NA; } }
SignatureTypeResolver { static String resolveSignatureType(ValidationConclusion validationConclusion) { if (CollectionUtils.isEmpty(validationConclusion.getSignatures()) || isTstTypeContainer(validationConclusion)) { return NA; } String signatureFormat = validationConclusion.getSignatures().get(0).getSignatureFormat(); if (isDdoc(signatureFormat) || isXades(signatureFormat)) { return XADES; } if (isCades(signatureFormat)) { return CADES; } if (isPades(signatureFormat)) { return PADES; } return NA; }  }
SignatureTypeResolver { static String resolveSignatureType(ValidationConclusion validationConclusion) { if (CollectionUtils.isEmpty(validationConclusion.getSignatures()) || isTstTypeContainer(validationConclusion)) { return NA; } String signatureFormat = validationConclusion.getSignatures().get(0).getSignatureFormat(); if (isDdoc(signatureFormat) || isXades(signatureFormat)) { return XADES; } if (isCades(signatureFormat)) { return CADES; } if (isPades(signatureFormat)) { return PADES; } return NA; }   }
SignatureTypeResolver { static String resolveSignatureType(ValidationConclusion validationConclusion) { if (CollectionUtils.isEmpty(validationConclusion.getSignatures()) || isTstTypeContainer(validationConclusion)) { return NA; } String signatureFormat = validationConclusion.getSignatures().get(0).getSignatureFormat(); if (isDdoc(signatureFormat) || isXades(signatureFormat)) { return XADES; } if (isCades(signatureFormat)) { return CADES; } if (isPades(signatureFormat)) { return PADES; } return NA; }    }