/** * Create an instance of {@link XmlConclusion } * */ public XmlConclusion createXmlConclusion() { return new XmlConclusion(); }
private void recordCustomSuccessConclusion() { XmlConclusion conclusion = new XmlConclusion(); conclusion.setIndication(getSuccessIndication()); conclusion.setSubIndication(getSuccessSubIndication()); result.setConclusion(conclusion); }
private void recordConclusion() { XmlConclusion conclusion = new XmlConclusion(); conclusion.setIndication(getFailedIndicationForConclusion()); conclusion.setSubIndication(getFailedSubIndicationForConclusion()); List<XmlName> previousErrors = getPreviousErrors(); if (Utils.isCollectionNotEmpty(previousErrors)) { conclusion.getErrors().addAll(previousErrors); } else { conclusion.getErrors().add(buildXmlName(getErrorMessageTag())); } result.setConclusion(conclusion); }
/** * This method allows to initialize and execute the complete chain until the first failure. * * @return the complete result with constraints and final conclusion for the chain */ public T execute() { initChain(); if (firstItem != null) { firstItem.execute(); } if (result.getConclusion() == null) { XmlConclusion conclusion = new XmlConclusion(); conclusion.setIndication(Indication.PASSED); result.setConclusion(conclusion); } addAdditionalInfo(); return result; }
@Test public void revocationFreshnessCheckerResult() throws Exception { LevelConstraint constraint = new LevelConstraint(); constraint.setLevel(Level.FAIL); XmlConclusion xc = new XmlConclusion(); xc.setIndication(Indication.PASSED); XmlRFC resultRFC = new XmlRFC(); resultRFC.setConclusion(xc); XmlSubXCV result = new XmlSubXCV(); RevocationFreshnessCheckerResult rfc = new RevocationFreshnessCheckerResult(result, resultRFC, constraint); rfc.execute(); List<XmlConstraint> constraints = result.getConstraint(); assertEquals(1, constraints.size()); assertEquals(XmlStatus.OK, constraints.get(0).getStatus()); }
@Test public void failedRevocationFreshnessCheckerResult() throws Exception { LevelConstraint constraint = new LevelConstraint(); constraint.setLevel(Level.FAIL); XmlConclusion xc = new XmlConclusion(); xc.setIndication(Indication.FAILED); XmlRFC resultRFC = new XmlRFC(); resultRFC.setConclusion(xc); XmlSubXCV result = new XmlSubXCV(); RevocationFreshnessCheckerResult rfc = new RevocationFreshnessCheckerResult(result, resultRFC, constraint); rfc.execute(); List<XmlConstraint> constraints = result.getConstraint(); assertEquals(1, constraints.size()); assertEquals(XmlStatus.NOT_OK, constraints.get(0).getStatus()); }
result.setId(token.getId()); result.setType(context); result.setConclusion(new XmlConclusion());