Skip to content

Commit

Permalink
test: createCall response assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
SMadani committed Jun 27, 2024
1 parent 09c6c27 commit ba86ac1
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/test/kotlin/com/vonage/client/kt/VoiceTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ class VoiceTest : AbstractTest() {
val eventMethod = HttpMethod.POST
val amdBehaviour = MachineDetection.HANGUP
val amdMode = AdvancedMachineDetection.Mode.DETECT_BEEP
val callStatus = CallStatus.RINGING
val callDirection = CallDirection.OUTBOUND
val wsContentType = "audio/l16;rate=8000"
val dtmf = "p*123#"
val vbcExt = "4321"
Expand Down Expand Up @@ -257,12 +259,12 @@ class VoiceTest : AbstractTest() {
"ringing_timer" to ringingTimer
), status = 201, expectedResponseParams = mapOf(
"uuid" to callIdStr,
"status" to "ringing",
"direction" to "outbound",
"status" to callStatus.name.lowercase(),
"direction" to callDirection.name.lowercase(),
"conversation_uuid" to conversationId
))

voiceClient.createCall {
val callEvent = voiceClient.createCall {
answerUrl(answerUrl); answerMethod(answerMethod)
from(fromPstn); fromRandomNumber(false);
eventUrl(eventUrl); eventMethod(eventMethod)
Expand All @@ -276,5 +278,11 @@ class VoiceTest : AbstractTest() {
SipEndpoint(sipUri, customHeaders, userToUserHeader)
)
}

assertNotNull(callEvent)
assertEquals(callIdStr, callEvent.uuid)
assertEquals(callStatus, callEvent.status)
assertEquals(callDirection, callEvent.direction)
assertEquals(conversationId, callEvent.conversationUuid)
}
}

0 comments on commit ba86ac1

Please sign in to comment.