Skip to content

Commit 800bc7a

Browse files
authored
Add missing experimentalApi annotations to vertex tests (#6541)
This reduces the noise we are seeing in our builds
1 parent feeb6a9 commit 800bc7a

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

firebase-vertexai/src/test/java/com/google/firebase/vertexai/common/UnarySnapshotTests.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import io.kotest.matchers.types.shouldBeInstanceOf
3535
import io.ktor.http.HttpStatusCode
3636
import kotlin.time.Duration.Companion.seconds
3737
import kotlinx.coroutines.withTimeout
38+
import kotlinx.serialization.ExperimentalSerializationApi
3839
import kotlinx.serialization.Serializable
3940
import kotlinx.serialization.json.JsonPrimitive
4041
import org.junit.Test
@@ -44,6 +45,7 @@ import org.junit.Test
4445
internal class UnarySnapshotTests {
4546
private val testTimeout = 5.seconds
4647

48+
@OptIn(ExperimentalSerializationApi::class)
4749
@Test
4850
fun `short reply`() =
4951
goldenUnaryFile("success-basic-reply-short.json") {
@@ -57,6 +59,7 @@ internal class UnarySnapshotTests {
5759
}
5860
}
5961

62+
@OptIn(ExperimentalSerializationApi::class)
6063
@Test
6164
fun `long reply`() =
6265
goldenUnaryFile("success-basic-reply-long.json") {
@@ -219,6 +222,7 @@ internal class UnarySnapshotTests {
219222
}
220223
}
221224

225+
@OptIn(ExperimentalSerializationApi::class)
222226
@Test
223227
fun `properly translates json text`() =
224228
goldenUnaryFile("success-constraint-decoding-json.json") {
@@ -305,6 +309,7 @@ internal class UnarySnapshotTests {
305309
}
306310
}
307311

312+
@OptIn(ExperimentalSerializationApi::class)
308313
@Test
309314
fun `function call contains null param`() =
310315
goldenUnaryFile("success-function-call-null.json") {
@@ -317,6 +322,7 @@ internal class UnarySnapshotTests {
317322
}
318323
}
319324

325+
@OptIn(ExperimentalSerializationApi::class)
320326
@Test
321327
fun `function call contains json literal`() =
322328
goldenUnaryFile("success-function-call-json-literal.json") {
@@ -335,6 +341,7 @@ internal class UnarySnapshotTests {
335341
}
336342
}
337343

344+
@OptIn(ExperimentalSerializationApi::class)
338345
@Test
339346
fun `function call has no arguments field`() =
340347
goldenUnaryFile("success-function-call-empty-arguments.json") {

firebase-vertexai/src/test/java/com/google/firebase/vertexai/common/util/tests.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import io.ktor.utils.io.close
3838
import io.ktor.utils.io.writeFully
3939
import java.io.File
4040
import kotlinx.coroutines.launch
41+
import kotlinx.serialization.ExperimentalSerializationApi
4142
import kotlinx.serialization.encodeToString
4243

4344
private val TEST_CLIENT_ID = "genai-android/test"
@@ -48,6 +49,7 @@ internal fun prepareStreamingResponse(response: List<GenerateContentResponse>):
4849
internal fun prepareResponse(response: GenerateContentResponse) =
4950
JSON.encodeToString(response).toByteArray()
5051

52+
@OptIn(ExperimentalSerializationApi::class)
5153
internal fun createRequest(vararg text: String): GenerateContentRequest {
5254
val contents = text.map { Content(parts = listOf(TextPart(it))) }
5355

@@ -56,6 +58,7 @@ internal fun createRequest(vararg text: String): GenerateContentRequest {
5658

5759
internal fun createResponse(text: String) = createResponses(text).single()
5860

61+
@OptIn(ExperimentalSerializationApi::class)
5962
internal fun createResponses(vararg text: String): List<GenerateContentResponse> {
6063
val candidates = text.map { Candidate(Content(parts = listOf(TextPart(it)))) }
6164

0 commit comments

Comments
 (0)