@Test
void testPrepareEncapsulatedAssertionEncassInDependencyBundle() throws DocumentParseException {

    String policyPath = "my/policy/path.xml";
    Encass encass = new Encass();
    encass.setGuid("123");
    encass.setId("id1");
    encass.setPolicy(policyPath);
    encass.setName(TEST_ENCASS);
    Bundle dependencyBundle = new Bundle();
    dependencyBundle.getEncasses().put(TEST_ENCASS, encass);
    bundle.getDependencies().add(dependencyBundle);
    Element encapsulatedAssertionElement = createEncapsulatedAssertionElement(document);
    document.appendChild(encapsulatedAssertionElement);
    policyBuilderContext = new PolicyBuilderContext("path.xml", document, bundle, new IdGenerator());
    policyBuilderContext.withPolicy(policy);
    policyBuilderContext.withAnnotatedBundle(null);
    encapsulatedAssertionBuilder.buildAssertionElement(encapsulatedAssertionElement, policyBuilderContext);
    Element nameElement = getSingleElement(encapsulatedAssertionElement, ENCAPSULATED_ASSERTION_CONFIG_NAME);
    assertEquals(TEST_ENCASS, nameElement.getAttribute(PolicyEntityBuilder.STRING_VALUE));
    Element guidElement = getSingleElement(encapsulatedAssertionElement, ENCAPSULATED_ASSERTION_CONFIG_GUID);
    assertEquals(encass.getGuid(), guidElement.getAttribute(PolicyEntityBuilder.STRING_VALUE));
}