@Test
public void testCreate() {

    final BooleanSupplier sysPropRestoreFunc = this.getSysPropRestoreLambda(
        "athenz.zts.keystore_signer.keystore_password",
        "athenz.zts.keystore_signer.keystore_path",
        "athenz.zts.keystore_signer.keystore_type",
        "athenz.zts.keystore_signer.keystore_ca_alias",
        ZTSConsts.ZTS_PROP_CERTSIGN_MAX_EXPIRY_TIME
    );
    // test main
    String filePath = Resources.getResource("keystore.pkcs12").getFile();
    System.setProperty("athenz.zts.keystore_signer.keystore_password", "123456");
    System.setProperty("athenz.zts.keystore_signer.keystore_path", filePath);
    System.setProperty("athenz.zts.keystore_signer.keystore_type", "JKS");
    System.setProperty("athenz.zts.keystore_signer.keystore_ca_alias", "unit");
    System.setProperty(ZTSConsts.ZTS_PROP_CERTSIGN_MAX_EXPIRY_TIME, "36000");
    try (KeyStoreCertSigner keyStoreCertSigner = (KeyStoreCertSigner) new KeyStoreCertSignerFactory().create()) {
        // assertion
        Function<String, Object> getFieldValue = (String fieldName) -> {
            try {
                Field field = keyStoreCertSigner.getClass().getDeclaredField(fieldName);
                field.setAccessible(true);
                return field.get(keyStoreCertSigner);
            } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
                return null;
            }
        };
        Assert.assertEquals(((X509Certificate) getFieldValue.apply("caCertificate")).getIssuerX500Principal().getName(), "CN=unit.test.athenz,OU=Athenz,O=Oath,L=PlayaVista,ST=CA,C=US");
        Assert.assertNotNull(getFieldValue.apply("caPrivateKey"));
        Assert.assertEquals(getFieldValue.apply("maxCertExpiryTimeMins"), 36000);
    } finally {
        sysPropRestoreFunc.getAsBoolean();
    }
}