// 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 kotlin.test.assertEquals
import kotlin.test.assertTrue
import kotlin.test.assertFalse
import kotlin.test.assertFailsWith
import kotlinx.coroutines.runBlocking
import dev.kreuzberg.Kreuzberg

/** E2e tests for category: plugin_api. */
class PluginApiTest {
    @Test
    fun testRegisterDocumentExtractorTraitBridge() = runBlocking {
        // register_document_extractor: trait bridge
        class TestStubRegisterDocumentExtractorTraitBridge : IDocumentExtractor {
    override fun name(): String = "register_document_extractor_trait_bridge"
    override suspend fun extractBytes(content: ByteArray, mimeType: String, config: ExtractionConfig): InternalDocument = InternalDocument()
    override fun supportedMimeTypes(): List<String> = emptyList()
}
// register via: DocumentExtractorBridge.register(TestStubRegisterDocumentExtractorTraitBridge())

        val result = DocumentExtractorBridge.register(TestStubRegisterDocumentExtractorTraitBridge())
    }

    @Test
    fun testRegisterEmbeddingBackendTraitBridge() = runBlocking {
        // register_embedding_backend: trait bridge
        class TestStubRegisterEmbeddingBackendTraitBridge : IEmbeddingBackend {
    override fun name(): String = "register_embedding_backend_trait_bridge"
    override fun dimensions(): Long = 0
    override suspend fun embed(texts: List<String>): List<List<Float>> = emptyList()
}
// register via: EmbeddingBackendBridge.register(TestStubRegisterEmbeddingBackendTraitBridge())

        val result = EmbeddingBackendBridge.register(TestStubRegisterEmbeddingBackendTraitBridge())
    }

    @Test
    fun testRegisterOcrBackendTraitBridge() = runBlocking {
        // register_ocr_backend: trait bridge
        class TestStubRegisterOcrBackendTraitBridge : IOcrBackend {
    override fun name(): String = "register_ocr_backend_trait_bridge"
    override suspend fun processImage(imageBytes: ByteArray, config: OcrConfig): ExtractionResult = ExtractionResult()
    override fun supportsLanguage(lang: String): Boolean = false
    override fun backendType(): OcrBackendType = OcrBackendType()
}
// register via: OcrBackendBridge.register(TestStubRegisterOcrBackendTraitBridge())

        val result = OcrBackendBridge.register(TestStubRegisterOcrBackendTraitBridge())
    }

    @Test
    fun testRegisterPostProcessorTraitBridge() = runBlocking {
        // register_post_processor: trait bridge
        class TestStubRegisterPostProcessorTraitBridge : IPostProcessor {
    override fun name(): String = "register_post_processor_trait_bridge"
    override suspend fun process(result: ExtractionResult, config: ExtractionConfig): Unit = null
    override fun processingStage(): ProcessingStage = ProcessingStage()
}
// register via: PostProcessorBridge.register(TestStubRegisterPostProcessorTraitBridge())

        val result = PostProcessorBridge.register(TestStubRegisterPostProcessorTraitBridge())
    }

    @Test
    fun testRegisterRendererTraitBridge() = runBlocking {
        // register_renderer: trait bridge
        class TestStubRegisterRendererTraitBridge : IRenderer {
    override fun name(): String = "register_renderer_trait_bridge"
    override fun render(doc: InternalDocument): String = ""
}
// register via: RendererBridge.register(TestStubRegisterRendererTraitBridge())

        val result = RendererBridge.register(TestStubRegisterRendererTraitBridge())
    }

    @Test
    fun testRegisterValidatorTraitBridge() = runBlocking {
        // register_validator: trait bridge
        class TestStubRegisterValidatorTraitBridge : IValidator {
    override fun name(): String = "register_validator_trait_bridge"
    override suspend fun validate(result: ExtractionResult, config: ExtractionConfig): Unit = null
}
// register via: ValidatorBridge.register(TestStubRegisterValidatorTraitBridge())

        val result = ValidatorBridge.register(TestStubRegisterValidatorTraitBridge())
    }

    @Test
    fun testUnregisterDocumentExtractorAfterRegister() = runBlocking {
        // unregister_document_extractor
        val result = DocumentExtractorBridge.unregister("test-extractor")
    }

    @Test
    fun testUnregisterEmbeddingBackendAfterRegister() = runBlocking {
        // unregister_embedding_backend
        val result = EmbeddingBackendBridge.unregister("test-embedding-backend")
    }

    @Test
    fun testUnregisterPostProcessorAfterRegister() = runBlocking {
        // unregister_post_processor
        val result = PostProcessorBridge.unregister("test-processor")
    }

    @Test
    fun testUnregisterRendererAfterRegister() = runBlocking {
        // unregister_renderer
        val result = RendererBridge.unregister("test-renderer")
    }

    @Test
    fun testUnregisterValidatorAfterRegister() = runBlocking {
        // unregister_validator
        val result = ValidatorBridge.unregister("test-validator")
    }

}
