// Path: upload-parser-tests/src/test/java/com/github/elopteryx/upload/internal/integration/RequestSupplier.java
// static ByteBuffer withSeveralFields() {
//     return RequestBuilder.newBuilder(BOUNDARY)
//             .addFilePart("filefield1", LARGE_FILE, "application/octet-stream", "file1.txt")
//             .addFilePart("filefield2", EMPTY_FILE, "text/plain", "file2.txt")
//             .addFilePart("filefield3", SMALL_FILE, "application/octet-stream", "file3.txt")
//             .addFormField("textfield1", TEXT_VALUE_1)
//             .addFormField("textfield2", TEXT_VALUE_2)
//             .addFilePart("filefield4", getContents("test.xlsx"), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "test.xlsx")
//             .addFilePart("filefield5", getContents("test.docx"), "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "test.docx")
//             .addFilePart("filefield6", getContents("test.jpg"), "image/jpeg", "test.jpg")
//             .finish();
// }


import static com.github.elopteryx.upload.internal.integration.RequestSupplier.withSeveralFields;
import static java.net.http.HttpClient.Version.HTTP_1_1;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.google.common.jimfs.Jimfs;
import org.apache.tika.Tika;
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.nio.file.FileSystem;
import java.time.Duration;
package com.github.elopteryx.upload.internal.integration;




/**
 * Utility class for making multipart requests.
 */
public final class ClientRequest {

    static final String BOUNDARY = "--TNoK9riv6EjfMhxBzj22SKGnOaIhZlxhar";

    static final String SIMPLE = "simple";
    static final String THRESHOLD_LESSER = "threshold_lesser";
    static final String THRESHOLD_GREATER = "threshold_greater";
    static final String ERROR = "error";
    static final String IO_ERROR_UPON_ERROR = "io_error_upon_error";
    static final String SERVLET_ERROR_UPON_ERROR = "servlet_error_upon_error";
    static final String COMPLEX = "complex";

    static final FileSystem FILE_SYSTEM = Jimfs.newFileSystem();

    static final Tika TIKA = new Tika();

    /**
     * Creates and sends a randomized multipart request for the
     * given address.
     * @param url The target address
     * @param expectedStatus The expected HTTP response, can be null
     * @throws IOException If an IO error occurred
     */
    public static void performRequest(final String url, final Integer expectedStatus) throws IOException {
// Path: upload-parser-tests/src/test/java/com/github/elopteryx/upload/internal/integration/RequestSupplier.java
// static ByteBuffer withSeveralFields() {
//     return RequestBuilder.newBuilder(BOUNDARY)
//             .addFilePart("filefield1", LARGE_FILE, "application/octet-stream", "file1.txt")
//             .addFilePart("filefield2", EMPTY_FILE, "text/plain", "file2.txt")
//             .addFilePart("filefield3", SMALL_FILE, "application/octet-stream", "file3.txt")
//             .addFormField("textfield1", TEXT_VALUE_1)
//             .addFormField("textfield2", TEXT_VALUE_2)
//             .addFilePart("filefield4", getContents("test.xlsx"), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "test.xlsx")
//             .addFilePart("filefield5", getContents("test.docx"), "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "test.docx")
//             .addFilePart("filefield6", getContents("test.jpg"), "image/jpeg", "test.jpg")
//             .finish();
// }


// Path: upload-parser-tests/src/test/java/com/github/elopteryx/upload/internal/integration/ClientRequest.java
import static com.github.elopteryx.upload.internal.integration.RequestSupplier.withSeveralFields;
import static java.net.http.HttpClient.Version.HTTP_1_1;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.google.common.jimfs.Jimfs;
import org.apache.tika.Tika;
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.nio.file.FileSystem;
import java.time.Duration;

package com.github.elopteryx.upload.internal.integration;




/**
 * Utility class for making multipart requests.
 */
public final class ClientRequest {

    static final String BOUNDARY = "--TNoK9riv6EjfMhxBzj22SKGnOaIhZlxhar";

    static final String SIMPLE = "simple";
    static final String THRESHOLD_LESSER = "threshold_lesser";
    static final String THRESHOLD_GREATER = "threshold_greater";
    static final String ERROR = "error";
    static final String IO_ERROR_UPON_ERROR = "io_error_upon_error";
    static final String SERVLET_ERROR_UPON_ERROR = "servlet_error_upon_error";
    static final String COMPLEX = "complex";

    static final FileSystem FILE_SYSTEM = Jimfs.newFileSystem();

    static final Tika TIKA = new Tika();

    /**
     * Creates and sends a randomized multipart request for the
     * given address.
     * @param url The target address
     * @param expectedStatus The expected HTTP response, can be null
     * @throws IOException If an IO error occurred
     */
    public static void performRequest(final String url, final Integer expectedStatus) throws IOException {
        performRequest(url, expectedStatus, withSeveralFields());