CalendarAuthenticationRecordSignatureVerificationRule extends BaseRule { public VerificationErrorCode getErrorCode() { return VerificationErrorCode.KEY_02; }  VerificationResultCode verifySignature(VerificationContext context); VerificationErrorCode getErrorCode();  }
@Test public void testSignatureVerificationUsesUnknownAlgorithmReturnsFailedStatus_Ok() throws Exception { X509Certificate mockCertificate = Mockito.mock(X509Certificate.class); Mockito.when(mockCertificate.getSigAlgName()).thenReturn("INVALID_ALG"); Mockito.when(context.getCertificate(Mockito.any(byte[].class))).thenReturn(mockCertificate); RuleResult result = rule.verify(context); Assert.assertEquals(result.getResultCode(), VerificationResultCode.FAIL); Assert.assertEquals(result.getErrorCode(), VerificationErrorCode.KEY_02); }