@Test
public void testLogRecord() {

    File file = new File("src/test/resources/cert_log.pem");
    String pem = null;
    try {
        pem = new String(Files.readAllBytes(file.toPath()));
    } catch (IOException ex) {
        fail();
    }
    X509Certificate cert = Crypto.loadX509Certificate(pem);
    Principal principal = SimplePrincipal.create("user", "joe", "creds");
    String logLine = X509CertUtils.logRecord(principal, "10.11.12.13", "athenz.provider",
            "instance-id-1234", cert);
    assertEquals(logLine, "10.11.12.13 user.joe athenz.provider \"instance-id-1234\" \"CN=athenz.api,O=Athenz,ST=CA,C=US\" \"CN=AthenzTestCA,O=AthenzTest,ST=CA,C=US\" 11380750808733699965 1629005177000");
    logLine = X509CertUtils.logRecord(null, "10.11.12.13", "athenz.provider", null, cert);
    assertEquals(logLine, "10.11.12.13 - athenz.provider - \"CN=athenz.api,O=Athenz,ST=CA,C=US\" \"CN=AthenzTestCA,O=AthenzTest,ST=CA,C=US\" 11380750808733699965 1629005177000");
}