AggregationHashChainIndexSuccessorRule extends BaseRule { public VerificationErrorCode getErrorCode() { return VerificationErrorCode.INT_12; }  VerificationResultCode verifySignature(VerificationContext context); VerificationErrorCode getErrorCode();  }
@Test public void testSignatureWithInvalidAggregationChainIndexValue() throws Exception { RuleResult result = rule.verify(build(TestUtil.loadSignature(SIGNATURE_AGGREGATION_HASH_CHAIN_INVALID_CHAIN_INDEX))); Assert.assertEquals(result.getResultCode(), VerificationResultCode.FAIL); Assert.assertEquals(rule.getErrorCode(), VerificationErrorCode.INT_12); }
@Test public void testSignatureWithMissingOneAggregationChain() throws Exception { RuleResult result = rule.verify(build(TestUtil.loadSignature(SIGNATURE_AGGREGATION_HASH_CHAIN_ONE_CHAIN_MISSING))); Assert.assertEquals(result.getResultCode(), VerificationResultCode.FAIL); Assert.assertEquals(rule.getErrorCode(), VerificationErrorCode.INT_12); }
@Test public void testValidSignature_Ok() throws Exception { RuleResult result = rule.verify(build(TestUtil.loadSignature(SIGNATURE_2017_03_14))); Assert.assertEquals(result.getResultCode(), VerificationResultCode.OK); Assert.assertNull(result.getErrorCode()); }