Skip to content

Commit

Permalink
test: Update subaccount name only
Browse files Browse the repository at this point in the history
  • Loading branch information
SMadani committed Sep 2, 2024
1 parent d375a59 commit a60d92e
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/test/kotlin/com/vonage/client/kt/SubaccountsTest.kt
Original file line number Diff line number Diff line change
@@ -254,7 +254,19 @@ class SubaccountsTest : AbstractTest() {
}

@Test
fun `update subaccount`() {
fun `update subaccount name only`() {
mockPatch(
expectedUrl = existingSubUrl, authType = authType,
expectedRequestParams = mapOf("name" to name),
expectedResponseParams = sampleSubaccountMap
)
val invocation = { existingSubaccount.update(name = name) }
assertEqualsSampleSubaccount(invocation())
assert401ApiResponseException<SubaccountsResponseException>(existingSubUrl, HttpMethod.PATCH, invocation)
}

@Test
fun `update subaccount both parameters`() {
mockPatch(
expectedUrl = existingSubUrl, authType = authType,
expectedRequestParams = mapOf(
@@ -264,9 +276,6 @@ class SubaccountsTest : AbstractTest() {
expectedResponseParams = sampleSubaccountMap
)
assertEqualsSampleSubaccount(existingSubaccount.update(name, usePrimary))
assert401ApiResponseException<SubaccountsResponseException>(existingSubUrl, HttpMethod.PATCH) {
existingSubaccount.update(usePrimaryAccountBalance = usePrimary)
}
}

@Test

0 comments on commit a60d92e

Please sign in to comment.