// 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.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHandler;
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 jakarta.servlet.http.HttpServletResponse;
    @Test
    void test_with_a_real_request_servlet_error_upon_error_async() {
        performRequest("http://localhost:8090/async?" + ClientRequest.SERVLET_ERROR_UPON_ERROR, null);
    }

    @Test
    void test_with_a_real_request_error_blocking() {
        performRequest("http://localhost:8090/blocking?" + ClientRequest.ERROR, HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
    }

    @Test
    void test_with_a_real_request_complex() {
        performRequest("http://localhost:8090/async?" + ClientRequest.COMPLEX, HttpServletResponse.SC_OK);
    }

    private void performRequest(final String url, final Integer expectedStatus) {
        try {
            ClientRequest.performRequest(url, expectedStatus);
        } catch (final IOException e) {
            if (expectedStatus != null) {
                fail("Status returned: " + expectedStatus);
            }
        }
    }

    private void performRequest(final String url, final Integer expectedStatus, final ByteBuffer requestData) {
        try {
            ClientRequest.performRequest(url, expectedStatus, requestData);
        } catch (final IOException e) {
            if (expectedStatus != null) {
// 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/JettyIntegrationTest.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.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHandler;
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 jakarta.servlet.http.HttpServletResponse;

    @Test
    void test_with_a_real_request_servlet_error_upon_error_async() {
        performRequest("http://localhost:8090/async?" + ClientRequest.SERVLET_ERROR_UPON_ERROR, null);
    }

    @Test
    void test_with_a_real_request_error_blocking() {
        performRequest("http://localhost:8090/blocking?" + ClientRequest.ERROR, HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
    }

    @Test
    void test_with_a_real_request_complex() {
        performRequest("http://localhost:8090/async?" + ClientRequest.COMPLEX, HttpServletResponse.SC_OK);
    }

    private void performRequest(final String url, final Integer expectedStatus) {
        try {
            ClientRequest.performRequest(url, expectedStatus);
        } catch (final IOException e) {
            if (expectedStatus != null) {
                fail("Status returned: " + expectedStatus);
            }
        }
    }

    private void performRequest(final String url, final Integer expectedStatus, final ByteBuffer requestData) {
        try {
            ClientRequest.performRequest(url, expectedStatus, requestData);
        } catch (final IOException e) {
            if (expectedStatus != null) {
                fail("Status returned: " + expectedStatus);