Skip to content

Commit 44175f3

Browse files
committed
test: Video exception responses
1 parent 22ec333 commit 44175f3

File tree

3 files changed

+264
-109
lines changed

3 files changed

+264
-109
lines changed

src/main/kotlin/com/vonage/client/kt/Video.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class Video(private val client: VideoClient) {
7171

7272
fun sendDtmf(digits: String): Unit = client.sendDtmf(id, digits)
7373

74-
fun startCaptions(token: String, properties: CaptionsRequest.Builder.() -> Unit): UUID =
74+
fun startCaptions(token: String, properties: CaptionsRequest.Builder.() -> Unit = {}): UUID =
7575
client.startCaptions(CaptionsRequest.builder()
7676
.apply(properties).sessionId(id).token(token).build()
7777
).captionsId

src/test/kotlin/com/vonage/client/kt/AbstractTest.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ abstract class AbstractTest {
294294

295295
assert401ApiResponseException<E>(url, requestMethod, actualCall)
296296
assert402ApiResponseException<E>(url, requestMethod, actualCall)
297+
assert403ApiResponseException<E>(url, requestMethod, actualCall)
297298
assert429ApiResponseException<E>(url, requestMethod, actualCall)
298299
}
299300

@@ -341,6 +342,14 @@ abstract class AbstractTest {
341342
"bf0ca0bf927b3b52e3cb03217e1a1ddf"
342343
)
343344

345+
protected inline fun <reified E: VonageApiResponseException> assert403ApiResponseException(
346+
url: String, requestMethod: HttpMethod, actualCall: () -> Any): E =
347+
assertApiResponseException(url, requestMethod, actualCall, 403,
348+
title = "Forbidden",
349+
code = "10001",
350+
detail = "Invalid token format or signature."
351+
)
352+
344353
protected inline fun <reified E: VonageApiResponseException> assert429ApiResponseException(
345354
url: String, requestMethod: HttpMethod, actualCall: () -> Any): E =
346355
assertApiResponseException(url, requestMethod, actualCall, 429,

0 commit comments

Comments
 (0)