// This file is auto-generated by alef — DO NOT EDIT.
// alef:hash:4e15143f4af1ae8bafbdb1506ef057da924484c66a19483966333558ad437e75
// To regenerate: alef generate
// To verify freshness: alef verify --exit-code
// Issues & docs: https://github.com/kreuzberg-dev/alef

package dev.kreuzberg.e2e;

import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import dev.kreuzberg.Kreuzberg;
import dev.kreuzberg.BatchBytesItem;
import dev.kreuzberg.BatchFileItem;
import dev.kreuzberg.ExtractionConfig;
import java.util.Optional;
import dev.kreuzberg.JsonUtil;

/** E2e tests for category: batch. */
class BatchTest {

    @Test
    void testBatchBytesInvalidMime() throws Exception {
        // batch_extract_bytes_sync invalid MIME
        var result = Kreuzberg.batchExtractBytesSync(java.util.Arrays.asList(new BatchBytesItem(new byte[] {(byte) 72, (byte) 101, (byte) 108, (byte) 108, (byte) 111}, "application/x-nonexistent", null)), ExtractionConfig.builder().build());


    }


    @Test
    void testBatchExtractBytesHappy() throws Exception {
        // batch_extract_bytes: happy path with mixed inputs
        var result = Kreuzberg.batchExtractBytes(java.util.Arrays.asList(new BatchBytesItem(new byte[] {(byte) 72, (byte) 101, (byte) 108, (byte) 108, (byte) 111, (byte) 44, (byte) 32, (byte) 119, (byte) 111, (byte) 114, (byte) 108, (byte) 100, (byte) 33}, "text/plain", null), new BatchBytesItem(new byte[] {(byte) 60, (byte) 104, (byte) 116, (byte) 109, (byte) 108, (byte) 62, (byte) 60, (byte) 98, (byte) 111, (byte) 100, (byte) 121, (byte) 62, (byte) 84, (byte) 101, (byte) 115, (byte) 116, (byte) 60, (byte) 47, (byte) 98, (byte) 111, (byte) 100, (byte) 121, (byte) 62, (byte) 60, (byte) 47, (byte) 104, (byte) 116, (byte) 109, (byte) 108, (byte) 62}, "text/html", null)), ExtractionConfig.builder().build());
assertTrue(result.size() >= 1, "expected at least 1 elements");

    }


    @Test
    void testBatchExtractBytesMixedFormat() throws Exception {
        // batch_extract_bytes: handles unsupported MIME gracefully
        var result = Kreuzberg.batchExtractBytes(java.util.Arrays.asList(new BatchBytesItem(new byte[] {(byte) 80, (byte) 68, (byte) 70, (byte) 32, (byte) 112, (byte) 108, (byte) 97, (byte) 99, (byte) 101, (byte) 104, (byte) 111, (byte) 108, (byte) 100, (byte) 101, (byte) 114}, "application/x-unknown", null)), ExtractionConfig.builder().build());


    }


    @Test
    void testBatchExtractBytesSyncEmptyList() throws Exception {
        // batch_extract_bytes_sync: empty batch
        var result = Kreuzberg.batchExtractBytesSync(java.util.Arrays.asList(), ExtractionConfig.builder().build());
assertEquals(0, result.size(), "expected exactly 0 elements");

    }


    @Test
    void testBatchExtractBytesSyncInvalidMime() throws Exception {
        // batch_extract_bytes_sync: unsupported MIME
        var result = Kreuzberg.batchExtractBytesSync(java.util.Arrays.asList(new BatchBytesItem(new byte[] {(byte) 100, (byte) 97, (byte) 116, (byte) 97}, "application/x-unknown", null)), ExtractionConfig.builder().build());


    }


    @Test
    void testBatchFileAsyncBasic() throws Exception {
        // Extract text from multiple files asynchronously
        var result = Kreuzberg.batchExtractFiles(java.util.Arrays.asList(new BatchFileItem(java.nio.file.Paths.get("pdf/fake_memo.pdf"), null), new BatchFileItem(java.nio.file.Paths.get("text/fake_text.txt"), null)), ExtractionConfig.builder().build());


    }


    @Test
    void testBatchFileAsyncNotFound() throws Exception {
        // batch_extract_file async nonexistent
        var result = Kreuzberg.batchExtractFiles(java.util.Arrays.asList(new BatchFileItem(java.nio.file.Paths.get("/nonexistent/a.pdf"), null)), ExtractionConfig.builder().build());


    }


    @Test
    void testBatchFileNotFound() throws Exception {
        // batch_extract_file_sync nonexistent
        var result = Kreuzberg.batchExtractFilesSync(java.util.Arrays.asList(new BatchFileItem(java.nio.file.Paths.get("/nonexistent/a.pdf"), null), new BatchFileItem(java.nio.file.Paths.get("/nonexistent/b.txt"), null)), ExtractionConfig.builder().build());


    }


    @Test
    void testBatchFilePartial() throws Exception {
        // batch_extract_file_sync mixed
        var result = Kreuzberg.batchExtractFilesSync(java.util.Arrays.asList(new BatchFileItem(java.nio.file.Paths.get("text/plain.txt"), null), new BatchFileItem(java.nio.file.Paths.get("/nonexistent/missing.pdf"), null)), ExtractionConfig.builder().build());


    }


    @Test
    void testBatchFileSyncBasic() throws Exception {
        // Extract text from multiple files synchronously
        var result = Kreuzberg.batchExtractFilesSync(java.util.Arrays.asList(new BatchFileItem(java.nio.file.Paths.get("pdf/fake_memo.pdf"), null), new BatchFileItem(java.nio.file.Paths.get("text/fake_text.txt"), null)), ExtractionConfig.builder().build());


    }

}
