@Test
void testErrorOnDuplicatePolicies() throws IOException {

    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_5_BUNDLE));
    File file2 = new File(originFolder, TEST_2_BUNDLE);
    file2.createNewFile();
    File file3 = new File(originFolder, TEST_5_BUNDLE);
    file3.createNewFile();
    Files.write(file2.toPath(), bundle2Contents);
    Files.write(file3.toPath(), bundle3Contents);
    // and try process them with error
    assertThrows(BundleLoadException.class, () -> processor.process(Stream.of(new File(originFolder, TEST_2_BUNDLE), new File(originFolder, TEST_3_BUNDLE)).collect(toCollection(LinkedList::new)), destinationFolder.toString()));
}