@Test
void testAttachingEncasses_notFound() throws IOException, DocumentParseException {

    File originFolder = new File(rootProjectDir.getRoot(), "original");
    originFolder.mkdirs();
    File destinationFolder = new File(rootProjectDir.getRoot(), "processed");
    destinationFolder.mkdirs();
    // copy the bundles
    byte[] bundle2Contents = IOUtils.toByteArray(Thread.currentThread().getContextClassLoader().getResource(TEST_2_BUNDLE));
    byte[] bundle3Contents = IOUtils.toByteArray(Thread.currentThread().getContextClassLoader().getResource(TEST_3_BUNDLE));
    File file2 = new File(originFolder, TEST_2_BUNDLE);
    file2.createNewFile();
    File file3 = new File(originFolder, TEST_3_BUNDLE);
    file3.createNewFile();
    Files.write(file2.toPath(), bundle2Contents);
    Files.write(file3.toPath(), bundle3Contents);
    // and process them
    LinkedList<File> processed = processor.process(Stream.of(new File(originFolder, TEST_2_BUNDLE), new File(originFolder, TEST_3_BUNDLE)).collect(toCollection(LinkedList::new)), destinationFolder.toString());
    assertNotNull(processed);
    assertEquals(2, processed.size());
    File bundle3 = processed.get(1);
    assertEquals(destinationFolder.toString() + File.separator + TEST_3_BUNDLE, bundle3.toString());
    File bundle2 = processed.get(0);
    assertEquals(destinationFolder.toString() + File.separator + TEST_2_BUNDLE, bundle2.toString());
    Document bundle2Doc = DocumentTools.INSTANCE.parse(bundle2);
    NodeList resources = bundle2Doc.getDocumentElement().getElementsByTagName(RESOURCE);
    assertNotNull(resources);
    assertEquals(3, resources.getLength());
    Element resourceElement = StreamSupport.stream(nodeList(resources).spliterator(), false).map(n -> (Element) n).filter(e -> PolicyEntityBuilder.POLICY.equals(e.getAttribute(ATTRIBUTE_TYPE))).findFirst().orElse(null);
    assertNotNull(resourceElement);
    String policyXML = resourceElement.getTextContent();
    assertNotNull(policyXML);
    Element policyElement = DocumentTools.INSTANCE.parse(policyXML).getDocumentElement();
    assertNotNull(policyElement);
    NodeList guids = policyElement.getElementsByTagName(ENCAPSULATED_ASSERTION_CONFIG_GUID);
    assertNotNull(guids);
    assertEquals(1, guids.getLength());
    String guid = guids.item(0).getAttributes().getNamedItem(STRING_VALUE).getTextContent();
    assertEquals(ZERO_GUID, guid);
}