@Test
public void testValidErrorCode() throws Exception {

    Field[] fields = CertificateVerifier.class.getFields();
    for (Field field : fields) {
        if (field.isAccessible()) {
            int errorCode = field.getInt(null);
            OpenSslCertificateException exception = new OpenSslCertificateException(errorCode);
            Assert.assertEquals(errorCode, exception.errorCode());
        }
    }
}