diff --git a/build.gradle.kts b/build.gradle.kts index 5af4f5f..1c56f2f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -52,30 +52,11 @@ kover { filters { excludes { classes( - "**Platform*", - "com.tddworks.**.request.*", - "com.tddworks.**.response.*", - "com.tddworks.**.data.*", -// "com.tddworks.**.internal.ktor.internal.*", -// "com.tddworks.**.**.ktor.internal.*", "com.tddworks.**.*\$*$*", // Lambda functions like - LemonSqueezyLicenseApi$activeLicense$activationResult$1 "com.tddworks.**.*\$Companion", // Lambda functions like - LemonSqueezyLicenseApi$activeLicense$activationResult$1 - "*.BuildConfig", - "*.BuildKonfig", // BuildKonfig generated - "*.ComposableSingletons*", // Jetpack Compose generated - "*.*\$*Preview\$*", // Jetpack Compose Preview functions - "*.ui.preview.*", // Jetpack Compose Preview providers - "*.*Test", // Test files - "*.*Test*", // Test cases - "*.*Mock", // mockative @Mock generated - "*.test.*", // Test util package "*.*\$\$serializer", // Kotlinx serializer) - "**.*\$Lambda$*.*", // Lambda functions - "**.*\$inlined$*", // Inlined functions - "**.*2\$1",// transactionWithResult - "**/**/*serializer*.*", - "**/**/*Companion*.*", ) +// inheritedFrom("org.koin.core.component.KoinComponent") // annotatedBy("kotlinx.serialization.Serializable") } includes { @@ -86,7 +67,7 @@ kover { verify { rule { bound { - minValue = 80 + minValue = 82 } } } diff --git a/openai-client/openai-client-core/src/jvmTest/kotlin/com/tddworks/openai/api/chat/api/ChatCompletionChunkTest.kt b/openai-client/openai-client-core/src/jvmTest/kotlin/com/tddworks/openai/api/chat/api/ChatCompletionChunkTest.kt new file mode 100644 index 0000000..40cc4f7 --- /dev/null +++ b/openai-client/openai-client-core/src/jvmTest/kotlin/com/tddworks/openai/api/chat/api/ChatCompletionChunkTest.kt @@ -0,0 +1,19 @@ +package com.tddworks.openai.api.chat.api + +import org.junit.jupiter.api.Assertions.* +import org.junit.jupiter.api.Test + +class ChatCompletionChunkTest { + + @Test + fun `should create dummy chunk`() { + val chunk = ChatCompletionChunk.dummy() + assertEquals("fake-id", chunk.id) + assertEquals("text", chunk.`object`) + assertEquals(0, chunk.created) + assertEquals("fake-model", chunk.model) + assertEquals(1, chunk.choices.size) + assertEquals(ChatChunk.fake(), chunk.choices[0]) + assertEquals("fake-content", chunk.content()) + } +} \ No newline at end of file diff --git a/openai-gateway/openai-gateway-core/src/jvmTest/kotlin/com/tddworks/anthropic/api/AnthropicConfigTest.kt b/openai-gateway/openai-gateway-core/src/jvmTest/kotlin/com/tddworks/anthropic/api/AnthropicConfigTest.kt new file mode 100644 index 0000000..dd0e524 --- /dev/null +++ b/openai-gateway/openai-gateway-core/src/jvmTest/kotlin/com/tddworks/anthropic/api/AnthropicConfigTest.kt @@ -0,0 +1,17 @@ +package com.tddworks.anthropic.api + +import org.junit.jupiter.api.Assertions.assertNotNull +import org.junit.jupiter.api.Test +import org.koin.core.context.startKoin +import org.koin.test.junit5.AutoCloseKoinTest + +class AnthropicConfigTest : AutoCloseKoinTest() { + + @Test + fun `fix the coverage by this case`() { + startKoin { + val r = AnthropicConfig().getKoin() + assertNotNull(r) + } + } +} \ No newline at end of file