@Test
void buildTrustedCertUsingDer() throws Exception {

    final File trustedCertLocation = new File(getClass().getClassLoader().getResource(CERT_NAME + ".der").getFile());
    final TrustedCertEntityBuilder builder = new TrustedCertEntityBuilder(new IdGenerator(), null, certFact);
    final Bundle bundle = new Bundle();
    final TrustedCert trustedCert = new TrustedCert(ImmutableMap.of(VERIFY_HOSTNAME, true), null);
    bundle.putAllTrustedCerts(ImmutableMap.of(CERT_NAME, trustedCert));
    bundle.putAllCertificateFiles(ImmutableMap.of(CERT_NAME, () -> new FileInputStream(trustedCertLocation)));
    final List<Entity> trustedCerts = builder.build(bundle, EntityBuilder.BundleType.ENVIRONMENT, DocumentTools.INSTANCE.getDocumentBuilder().newDocument());
    assertEquals(1, trustedCerts.size());
    final Element trustedCertEntityXml = verifyTrustedCertElement(trustedCerts, false);
    verifyProperties(trustedCertEntityXml);
    verifyCertDetails(trustedCertEntityXml);
}