@@ -0,0 +1,2733 @@
+package eu.europa.esig.dss.validation.policy.bbb;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport eu.europa.esig.dss.EN319102.bbb.isc.IdentificationOfTheSigningCertificate;%0Aimport eu.europa.esig.dss.EN319102.policy.ValidationPolicy.Context;%0Aimport eu.europa.esig.dss.jaxb.detailedreport.XmlConstraint;%0Aimport eu.europa.esig.dss.jaxb.detailedreport.XmlISC;%0Aimport eu.europa.esig.dss.validation.policy.bbb.util.TestDiagnosticDataGenerator;%0Aimport eu.europa.esig.dss.validation.policy.bbb.util.TestPolicyGenerator;%0Aimport eu.europa.esig.dss.validation.policy.rules.Indication;%0Aimport eu.europa.esig.dss.validation.policy.rules.SubIndication;%0Aimport eu.europa.esig.dss.validation.report.DiagnosticData;%0Aimport eu.europa.esig.jaxb.policy.Level;%0Aimport eu.europa.esig.jaxb.policy.LevelConstraint;%0A%0Apublic class IdentificationOfTheSigningCertificateTest %7B%0A%0A%09private static final Logger logger = LoggerFactory.getLogger(IdentificationOfTheSigningCertificateTest.class);%0A%09%09%09%0A%09@Test%0A%09public void testWithBasicData() throws Exception %7B%0A%09%09DiagnosticData diagnosticData = TestDiagnosticDataGenerator.generateSimpleDiagnosticData();%0A%09%09%0A%09%09LevelConstraint failLevel = new LevelConstraint();%0A%09%09failLevel.setLevel(Level.FAIL);%0A%09%09%0A%09%09IdentificationOfTheSigningCertificate verification = new IdentificationOfTheSigningCertificate(diagnosticData, diagnosticData.getSignatures().get(0), Context.SIGNATURE, TestPolicyGenerator.generatePolicy());%0A%09%09XmlISC isc = verification.execute();%0A%09%09%0A%09%09for(XmlConstraint constraint : isc.getConstraints()) %7B%0A%09%09%09logger.info(constraint.getName().getValue() + %22 : %22 + constraint.getStatus());%0A%09%09%7D%0A%09%09%0A%09%09Assert.assertEquals(Indication.VALID, isc.getConclusion().getIndication());%0A%09%09Assert.assertEquals(6, isc.getConstraints().size());%0A%09%7D%0A%09%0A%09@Test%0A%09public void testWithDigestNotPresent() throws Exception %7B%0A%09%09DiagnosticData diagnosticData = TestDiagnosticDataGenerator.generateDiagnosticDataWithDigestValueOfTheCertificateNotPresent();%0A%09%09%0A%09%09LevelConstraint failLevel = new LevelConstraint();%0A%09%09failLevel.setLevel(Level.FAIL);%0A%09%09%0A%09%09IdentificationOfTheSigningCertificate verification = new IdentificationOfTheSigningCertificate(diagnosticData, diagnosticData.getSignatures().get(0), Context.SIGNATURE, TestPolicyGenerator.generatePolicy());%0A%09%09XmlISC isc = verification.execute();%0A%09%09%0A%09%09for(XmlConstraint constraint : isc.getConstraints()) %7B%0A%09%09%09logger.info(constraint.getName().getValue() + %22 : %22 + constraint.getStatus());%0A%09%09%7D%0A%09%09%0A%09%09Assert.assertEquals(Indication.INVALID, isc.getConclusion().getIndication());%0A%09%09Assert.assertEquals(SubIndication.FORMAT_FAILURE, isc.getConclusion().getSubIndication());%0A%09%09Assert.assertEquals(4, isc.getConstraints().size());%0A%09%7D%0A%7D%0A

Add IdentificationOfTheSigningCertificate test