@Test
void load() throws Exception {

    TrustedCertLoader loader = new TrustedCertLoader();
    Bundle bundle = new Bundle();
    loader.load(bundle, buildTrustedCertElement(DocumentTools.INSTANCE.getDocumentBuilder().newDocument(), BigInteger.valueOf(123456L)));
    assertFalse(bundle.getTrustedCerts().isEmpty());
    assertEquals(1, bundle.getTrustedCerts().size());
    TrustedCert cert = bundle.getTrustedCerts().get("Cert");
    assertNotNull(cert);
    assertNotNull(cert.getCertificateData());
    CertificateData certData = cert.getCertificateData();
    assertEquals("Encoded", certData.getEncodedData());
    assertEquals("Issuer", certData.getIssuerName());
    assertEquals("SN", certData.getSubjectName());
    assertEquals(BigInteger.valueOf(123456L), certData.getSerialNumber());
    final BeanInfo info = Introspector.getBeanInfo(TrustedCert.class);
    final Map<String, PropertyDescriptor> properties = stream(info.getPropertyDescriptors()).collect(toMap(FeatureDescriptor::getName, Function.identity()));
    CERT_PROPERTIES.forEach((k,v) -> {
        try {
            boolean value = (boolean) properties.get(k).getReadMethod().invoke(cert);
            assertTrue(value, "property " + k + " is not true");
        } catch (Exception e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    });
}