// Path: upload-parser-tests/src/test/java/com/github/elopteryx/upload/internal/integration/RequestSupplier.java
// static ByteBuffer withOneLargerPicture() {
//     return RequestBuilder.newBuilder(BOUNDARY)
//             .addFilePart("filefield", new byte[2048], "image/jpeg", "test.jpg")
//             .finish();
// }
// 
// Path: upload-parser-tests/src/test/java/com/github/elopteryx/upload/internal/integration/RequestSupplier.java
// static ByteBuffer withOneSmallerPicture() {
//     return RequestBuilder.newBuilder(BOUNDARY)
//             .addFilePart("filefield", new byte[512], "image/jpeg", "test.jpg")
//             .finish();
// }


import static com.github.elopteryx.upload.internal.integration.RequestSupplier.withOneLargerPicture;
import static com.github.elopteryx.upload.internal.integration.RequestSupplier.withOneSmallerPicture;
import static org.junit.jupiter.api.Assertions.fail;
import org.apache.catalina.WebResourceRoot;
import org.apache.catalina.core.StandardContext;
import org.apache.catalina.startup.Tomcat;
import org.apache.catalina.webresources.DirResourceSet;
import org.apache.catalina.webresources.StandardRoot;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.file.Files;
import java.nio.file.Paths;
import jakarta.servlet.http.HttpServletResponse;
                additionWebInfClasses.toAbsolutePath().toString(), "/"));
        context.setResources(resources);
        context.getJarScanner().setJarScanFilter((jarScanType, jarName) -> false);

        server.getConnector();
        server.start();
    }

    @Test
    void test_with_a_real_request_simple_async() {
        performRequest("http://localhost:8100/async?" + ClientRequest.SIMPLE, HttpServletResponse.SC_OK);
    }

    @Test
    void test_with_a_real_request_simple_blocking() {
        performRequest("http://localhost:8100/blocking?" + ClientRequest.SIMPLE, HttpServletResponse.SC_OK);
    }

    @Test
    void test_with_a_real_request_threshold_lesser_async() {
        performRequest("http://localhost:8100/async?" + ClientRequest.THRESHOLD_LESSER, HttpServletResponse.SC_OK, withOneSmallerPicture());
    }

    @Test
    void test_with_a_real_request_threshold_lesser_blocking() {
        performRequest("http://localhost:8100/blocking?" + ClientRequest.THRESHOLD_LESSER, HttpServletResponse.SC_OK, withOneSmallerPicture());
    }

    @Test
    void test_with_a_real_request_threshold_greater_async() {
// Path: upload-parser-tests/src/test/java/com/github/elopteryx/upload/internal/integration/RequestSupplier.java
// static ByteBuffer withOneLargerPicture() {
//     return RequestBuilder.newBuilder(BOUNDARY)
//             .addFilePart("filefield", new byte[2048], "image/jpeg", "test.jpg")
//             .finish();
// }
// 
// Path: upload-parser-tests/src/test/java/com/github/elopteryx/upload/internal/integration/RequestSupplier.java
// static ByteBuffer withOneSmallerPicture() {
//     return RequestBuilder.newBuilder(BOUNDARY)
//             .addFilePart("filefield", new byte[512], "image/jpeg", "test.jpg")
//             .finish();
// }


// Path: upload-parser-tests/src/test/java/com/github/elopteryx/upload/internal/integration/TomcatIntegrationTest.java
import static com.github.elopteryx.upload.internal.integration.RequestSupplier.withOneLargerPicture;
import static com.github.elopteryx.upload.internal.integration.RequestSupplier.withOneSmallerPicture;
import static org.junit.jupiter.api.Assertions.fail;
import org.apache.catalina.WebResourceRoot;
import org.apache.catalina.core.StandardContext;
import org.apache.catalina.startup.Tomcat;
import org.apache.catalina.webresources.DirResourceSet;
import org.apache.catalina.webresources.StandardRoot;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.file.Files;
import java.nio.file.Paths;
import jakarta.servlet.http.HttpServletResponse;

                additionWebInfClasses.toAbsolutePath().toString(), "/"));
        context.setResources(resources);
        context.getJarScanner().setJarScanFilter((jarScanType, jarName) -> false);

        server.getConnector();
        server.start();
    }

    @Test
    void test_with_a_real_request_simple_async() {
        performRequest("http://localhost:8100/async?" + ClientRequest.SIMPLE, HttpServletResponse.SC_OK);
    }

    @Test
    void test_with_a_real_request_simple_blocking() {
        performRequest("http://localhost:8100/blocking?" + ClientRequest.SIMPLE, HttpServletResponse.SC_OK);
    }

    @Test
    void test_with_a_real_request_threshold_lesser_async() {
        performRequest("http://localhost:8100/async?" + ClientRequest.THRESHOLD_LESSER, HttpServletResponse.SC_OK, withOneSmallerPicture());
    }

    @Test
    void test_with_a_real_request_threshold_lesser_blocking() {
        performRequest("http://localhost:8100/blocking?" + ClientRequest.THRESHOLD_LESSER, HttpServletResponse.SC_OK, withOneSmallerPicture());
    }

    @Test
    void test_with_a_real_request_threshold_greater_async() {
        performRequest("http://localhost:8100/async?" + ClientRequest.THRESHOLD_GREATER, HttpServletResponse.SC_OK, withOneLargerPicture());