@BeforeEach
    public void setUp() throws IOException {
        inputDir = basedir.resolve("input");

        bytesDir = basedir.resolve("bytes");

        jsonDir = basedir.resolve("json");

        configDir = basedir.resolve("config");
        Path tikaConfig = configDir.resolve("tika-config.xml");

        Files.createDirectories(basedir);
        Files.createDirectories(configDir);
        Files.createDirectories(inputDir);

        String xml = IOUtils.toString(AsyncProcessorTest.class.getResourceAsStream("/configs/TIKA-4207-emitter.xml"), StandardCharsets.UTF_8);
        //do stuff to xml
        xml = xml.replace("BASE_PATH", inputDir
                .toAbsolutePath()
                .toString());
        xml = xml.replace("JSON_PATH", jsonDir
                .toAbsolutePath()
                .toString());
        xml = xml.replace("BYTES_PATH", bytesDir
                .toAbsolutePath()
                .toString());

        Files.writeString(tikaConfig, xml, StandardCharsets.UTF_8);

        Path mock = inputDir.resolve("mock.xml");
        try (OutputStream os = Files.newOutputStream(mock)) {
            IOUtils.copy(getClass().getResourceAsStream("/test-documents/basic_embedded.xml"), os);
        }
    }
This should be in tika-core, but we want to avoid a dependency mess with tika-serialization
tika-pipes/tika-async-cli/src/test/java/org/apache/tika/async/cli/AsyncProcessorTest.java