@Test
public void testGenerateSSHCertRecord() {

    Principal principal = SimplePrincipal.create("user_domain", "user1",
            "v=U1;d=user_domain;n=user;s=signature", 0, null);
    ResourceContext context = createResourceContext(principal);
    SSHCertRecord sshRecord = zts.generateSSHCertRecord(context, "api", "id001", "127.0.0.1");
    assertEquals(sshRecord.getPrivateIP(), "127.0.0.1");
    assertEquals(sshRecord.getClientIP(), MOCKCLIENTADDR);
    assertEquals(sshRecord.getService(), "api");
    assertEquals(sshRecord.getInstanceId(), "id001");
    sshRecord = zts.generateSSHCertRecord(context, "api", "id001", "");
    assertEquals(sshRecord.getPrivateIP(), MOCKCLIENTADDR);
    assertEquals(sshRecord.getClientIP(), MOCKCLIENTADDR);
    sshRecord = zts.generateSSHCertRecord(context, "api", "id001", null);
    assertEquals(sshRecord.getPrivateIP(), MOCKCLIENTADDR);
    assertEquals(sshRecord.getClientIP(), MOCKCLIENTADDR);
}