From 8e9c041826b90947811c27a5b0830aa1e9a5daa4 Mon Sep 17 00:00:00 2001 From: AnasNaouchi Date: Wed, 10 Jul 2024 03:49:43 +0700 Subject: [PATCH] Fix unit tests --- .../java/co/omise/android/ui/PaymentCreatorActivityTest.kt | 4 ++-- sdk/src/test/java/co/omise/android/TokenizationMethodTest.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/src/androidTest/java/co/omise/android/ui/PaymentCreatorActivityTest.kt b/sdk/src/androidTest/java/co/omise/android/ui/PaymentCreatorActivityTest.kt index 085aec5d..bf4a1dbc 100644 --- a/sdk/src/androidTest/java/co/omise/android/ui/PaymentCreatorActivityTest.kt +++ b/sdk/src/androidTest/java/co/omise/android/ui/PaymentCreatorActivityTest.kt @@ -145,11 +145,11 @@ class PaymentCreatorActivityTest { onView( withListId(R.id.recycler_view).atPosition(1), ).check(matches(ViewMatchers.isEnabled())) - .check(matches(ViewMatchers.hasDescendant(ViewMatchers.withText(R.string.googlepay)))) + .check(matches(ViewMatchers.hasDescendant(ViewMatchers.withText(R.string.payment_truemoney_title)))) onView( withListId(R.id.recycler_view).atPosition(2), ).check(matches(ViewMatchers.isEnabled())) - .check(matches(ViewMatchers.hasDescendant(ViewMatchers.withText(R.string.payment_truemoney_title)))) + .check(matches(ViewMatchers.hasDescendant(ViewMatchers.withText(R.string.googlepay)))) onView(ViewMatchers.withText(R.string.payment_method_fpx_title)).check(doesNotExist()) onView(withId(R.id.recycler_view)) .check(matches(itemCount(3))) diff --git a/sdk/src/test/java/co/omise/android/TokenizationMethodTest.kt b/sdk/src/test/java/co/omise/android/TokenizationMethodTest.kt index 12fd2bd0..5065b5db 100644 --- a/sdk/src/test/java/co/omise/android/TokenizationMethodTest.kt +++ b/sdk/src/test/java/co/omise/android/TokenizationMethodTest.kt @@ -36,8 +36,8 @@ class TokenizationMethodTest { ) capability.paymentMethods?.any { it.name == "Method no: 1" }?.let { assertTrue(it) } - capability.paymentMethods?.any { it.name == "googlepay" }?.let { assertTrue(it) } - capability.paymentMethods?.any { it.name == "kanpay" }?.let { assertTrue(it) } + capability.tokenizationMethods?.any { it == "googlepay" }?.let { assertTrue(it) } + capability.tokenizationMethods?.any { it == "kanpay" }?.let { assertTrue(it) } } @Test