Skip to content

Commit a60d92e

Browse files
committed
test: Update subaccount name only
1 parent d375a59 commit a60d92e

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,19 @@ class SubaccountsTest : AbstractTest() {
254254
}
255255

256256
@Test
257-
fun `update subaccount`() {
257+
fun `update subaccount name only`() {
258+
mockPatch(
259+
expectedUrl = existingSubUrl, authType = authType,
260+
expectedRequestParams = mapOf("name" to name),
261+
expectedResponseParams = sampleSubaccountMap
262+
)
263+
val invocation = { existingSubaccount.update(name = name) }
264+
assertEqualsSampleSubaccount(invocation())
265+
assert401ApiResponseException<SubaccountsResponseException>(existingSubUrl, HttpMethod.PATCH, invocation)
266+
}
267+
268+
@Test
269+
fun `update subaccount both parameters`() {
258270
mockPatch(
259271
expectedUrl = existingSubUrl, authType = authType,
260272
expectedRequestParams = mapOf(
@@ -264,9 +276,6 @@ class SubaccountsTest : AbstractTest() {
264276
expectedResponseParams = sampleSubaccountMap
265277
)
266278
assertEqualsSampleSubaccount(existingSubaccount.update(name, usePrimary))
267-
assert401ApiResponseException<SubaccountsResponseException>(existingSubUrl, HttpMethod.PATCH) {
268-
existingSubaccount.update(usePrimaryAccountBalance = usePrimary)
269-
}
270279
}
271280

272281
@Test

0 commit comments

Comments
 (0)