@Test
public void loadCertificateAuthorityBundles() throws IOException {

    System.setProperty(ZTSConsts.ZTS_PROP_CERT_BUNDLES_FNAME, "src/test/resources/ca-bundle-file.json");
    InstanceCertManager certManager = new InstanceCertManager(null, null, null, true);
    // test our valid bundles. athenz and system should present same data
    // since one just includes comments
    CertificateAuthorityBundle bundleAthenz = certManager.getCertificateAuthorityBundle("athenz");
    assertNotNull(bundleAthenz);
    assertEquals(bundleAthenz.getName(), "athenz");
    final String athenzData = bundleAthenz.getCerts();
    CertificateAuthorityBundle bundleSystem = certManager.getCertificateAuthorityBundle("system");
    assertNotNull(bundleSystem);
    assertEquals(bundleSystem.getName(), "system");
    final String systemData = bundleSystem.getCerts();
    assertEquals(athenzData, systemData);
    // compare the contents with the actual file contents
    File caFile = new File("src/test/resources/x509_certs_no_comments.pem");
    byte[] data = Files.readAllBytes(Paths.get(caFile.toURI()));
    assertEquals(athenzData, new String(data));
    CertificateAuthorityBundle bundleSsh = certManager.getCertificateAuthorityBundle("ssh");
    assertNotNull(bundleSsh);
    assertEquals(bundleSsh.getName(), "ssh");
    final String sshData = bundleSsh.getCerts();
    assertEquals(sshData, "ssh-certificate-authority-keys");
    System.clearProperty(ZTSConsts.ZTS_PROP_CERT_BUNDLES_FNAME);
}