diff --git a/src/test/kotlin/com/vonage/client/kt/SubaccountsTest.kt b/src/test/kotlin/com/vonage/client/kt/SubaccountsTest.kt index cec5b3d..bceddcd 100644 --- a/src/test/kotlin/com/vonage/client/kt/SubaccountsTest.kt +++ b/src/test/kotlin/com/vonage/client/kt/SubaccountsTest.kt @@ -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(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(existingSubUrl, HttpMethod.PATCH) { - existingSubaccount.update(usePrimaryAccountBalance = usePrimary) - } } @Test