// 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.ExtractionConfig;
import java.util.Optional;
import dev.kreuzberg.JsonUtil;

/** E2e tests for category: plugin_api. */
class PluginApiTest {

    @Test
    void testRegisterDocumentExtractorTraitBridge() throws Exception {
        // register_document_extractor: trait bridge
        class TestStubRegisterDocumentExtractorTraitBridge implements dev.kreuzberg.IDocumentExtractor {
    @Override
    public String extract_bytes(byte[] content, String mimeType, dev.kreuzberg.ExtractionConfig config) {
        return "";
    }
    @Override
    public String extract_file(java.nio.file.Path path, String mimeType, dev.kreuzberg.ExtractionConfig config) {
        return "";
    }
    @Override
    public java.util.List<String> supported_mime_types() {
        return new java.util.ArrayList<>();
    }
    @Override
    public int priority() {
        return 0;
    }
    @Override
    public boolean can_handle(java.nio.file.Path path, String mimeType) {
        return false;
    }
    @Override
    public String name() { return "test-extractor"; }
    @Override
    public String version() {
        return "";
    }
    @Override
    public void initialize() {}
    @Override
    public void shutdown() {}
}

        Kreuzberg.registerDocumentExtractor(new TestStubRegisterDocumentExtractorTraitBridge());

        Kreuzberg.unregisterDocumentExtractor("test-extractor");

    }


    @Test
    void testRegisterEmbeddingBackendTraitBridge() throws Exception {
        // register_embedding_backend: trait bridge
        class TestStubRegisterEmbeddingBackendTraitBridge implements dev.kreuzberg.IEmbeddingBackend {
    @Override
    public long dimensions() {
        return 0;
    }
    @Override
    public java.util.List<java.util.List<Float>> embed(java.util.List<String> texts) {
        return new java.util.ArrayList<>();
    }
    @Override
    public String name() { return "test-embedding-backend"; }
    @Override
    public String version() {
        return "";
    }
    @Override
    public void initialize() {}
    @Override
    public void shutdown() {}
}

        Kreuzberg.registerEmbeddingBackend(new TestStubRegisterEmbeddingBackendTraitBridge());

        Kreuzberg.unregisterEmbeddingBackend("test-embedding-backend");

    }


    @Test
    void testRegisterOcrBackendTraitBridge() throws Exception {
        // register_ocr_backend: trait bridge
        class TestStubRegisterOcrBackendTraitBridge implements dev.kreuzberg.IOcrBackend {
    @Override
    public dev.kreuzberg.ExtractionResult process_image(byte[] imageBytes, dev.kreuzberg.OcrConfig config) {
        return null;
    }
    @Override
    public dev.kreuzberg.ExtractionResult process_image_file(java.nio.file.Path path, dev.kreuzberg.OcrConfig config) {
        return null;
    }
    @Override
    public boolean supports_language(String lang) {
        return false;
    }
    @Override
    public String backend_type() {
        return "";
    }
    @Override
    public java.util.List<String> supported_languages() {
        return new java.util.ArrayList<>();
    }
    @Override
    public boolean supports_table_detection() {
        return false;
    }
    @Override
    public boolean supports_document_processing() {
        return false;
    }
    @Override
    public dev.kreuzberg.ExtractionResult process_document(java.nio.file.Path path, dev.kreuzberg.OcrConfig config) {
        return null;
    }
    @Override
    public String name() { return "test-backend"; }
    @Override
    public String version() {
        return "";
    }
    @Override
    public void initialize() {}
    @Override
    public void shutdown() {}
}

        Kreuzberg.registerOcrBackend(new TestStubRegisterOcrBackendTraitBridge());

        Kreuzberg.unregisterOcrBackend("test-backend");

    }


    @Test
    void testRegisterPostProcessorTraitBridge() throws Exception {
        // register_post_processor: trait bridge
        class TestStubRegisterPostProcessorTraitBridge implements dev.kreuzberg.IPostProcessor {
    @Override
    public void process(dev.kreuzberg.ExtractionResult result, dev.kreuzberg.ExtractionConfig config) {}
    @Override
    public String processing_stage() {
        return "";
    }
    @Override
    public boolean should_process(dev.kreuzberg.ExtractionResult result, dev.kreuzberg.ExtractionConfig config) {
        return false;
    }
    @Override
    public long estimated_duration_ms(dev.kreuzberg.ExtractionResult result) {
        return 0;
    }
    @Override
    public int priority() {
        return 0;
    }
    @Override
    public String name() { return "test-processor"; }
    @Override
    public String version() {
        return "";
    }
    @Override
    public void initialize() {}
    @Override
    public void shutdown() {}
}

        Kreuzberg.registerPostProcessor(new TestStubRegisterPostProcessorTraitBridge());

        Kreuzberg.unregisterPostProcessor("test-processor");

    }


    @Test
    void testRegisterRendererTraitBridge() throws Exception {
        // register_renderer: trait bridge
        class TestStubRegisterRendererTraitBridge implements dev.kreuzberg.IRenderer {
    @Override
    public String render(String doc) {
        return "";
    }
    @Override
    public String name() { return "test-renderer"; }
    @Override
    public String version() {
        return "";
    }
    @Override
    public void initialize() {}
    @Override
    public void shutdown() {}
}

        Kreuzberg.registerRenderer(new TestStubRegisterRendererTraitBridge());

        Kreuzberg.unregisterRenderer("test-renderer");

    }


    @Test
    void testRegisterValidatorTraitBridge() throws Exception {
        // register_validator: trait bridge
        class TestStubRegisterValidatorTraitBridge implements dev.kreuzberg.IValidator {
    @Override
    public void validate(dev.kreuzberg.ExtractionResult result, dev.kreuzberg.ExtractionConfig config) {}
    @Override
    public boolean should_validate(dev.kreuzberg.ExtractionResult result, dev.kreuzberg.ExtractionConfig config) {
        return false;
    }
    @Override
    public int priority() {
        return 0;
    }
    @Override
    public String name() { return "test-validator"; }
    @Override
    public String version() {
        return "";
    }
    @Override
    public void initialize() {}
    @Override
    public void shutdown() {}
}

        Kreuzberg.registerValidator(new TestStubRegisterValidatorTraitBridge());

        Kreuzberg.unregisterValidator("test-validator");

    }


    @Test
    void testUnregisterDocumentExtractorAfterRegister() throws Exception {
        // unregister_document_extractor
        Kreuzberg.unregisterDocumentExtractor("test-extractor");


    }


    @Test
    void testUnregisterEmbeddingBackendAfterRegister() throws Exception {
        // unregister_embedding_backend
        Kreuzberg.unregisterEmbeddingBackend("test-embedding-backend");


    }


    @Test
    void testUnregisterPostProcessorAfterRegister() throws Exception {
        // unregister_post_processor
        Kreuzberg.unregisterPostProcessor("test-processor");


    }


    @Test
    void testUnregisterRendererAfterRegister() throws Exception {
        // unregister_renderer
        Kreuzberg.unregisterRenderer("test-renderer");


    }


    @Test
    void testUnregisterValidatorAfterRegister() throws Exception {
        // unregister_validator
        Kreuzberg.unregisterValidator("test-validator");


    }

}
