From 1adf8b69c881fd38baf3676bb72f420e426266bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Irfan=20=C3=96m=C3=BCr?= Date: Thu, 16 Jan 2025 11:22:33 +0300 Subject: [PATCH] Fix IDE warnings in SurveyTypeTest --- .../woocommerce/android/ui/feedback/SurveyTypeTest.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/feedback/SurveyTypeTest.kt b/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/feedback/SurveyTypeTest.kt index d06cce4a417..684654a9e86 100644 --- a/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/feedback/SurveyTypeTest.kt +++ b/WooCommerce/src/test/kotlin/com/woocommerce/android/ui/feedback/SurveyTypeTest.kt @@ -9,29 +9,29 @@ import org.junit.Test class SurveyTypeTest { @Test fun `SurveyType url should include platform tag for any URL`() { - assertThat(SurveyType.values()).allSatisfy { + assertThat(SurveyType.entries.toTypedArray()).allSatisfy { assertThat(it.url.contains("woo-mobile-platform=android")).isTrue() } } @Test fun `Product SurveyType url should include a milestone tag`() { - assertThat(PRODUCT.url.contains(Regex("product-milestone=$anyDigitAndNothingAfter"))).isTrue() + assertThat(PRODUCT.url.contains(Regex("product-milestone=$ANY_DIGIT_AND_NOTHING_AFTER"))).isTrue() } @Test fun `Main SurveyType url should NOT include a milestone tag`() { - assertThat(MAIN.url.contains(Regex("milestone=$anyDigitAndNothingAfter"))).isFalse() + assertThat(MAIN.url.contains(Regex("milestone=$ANY_DIGIT_AND_NOTHING_AFTER"))).isFalse() } @Test fun `SurveyType url should include app version form tag for any URL`() { - assertThat(SurveyType.values()).allSatisfy { + assertThat(SurveyType.entries.toTypedArray()).allSatisfy { assertThat(it.url.contains("app-version=${BuildConfig.VERSION_NAME}")).isTrue() } } companion object { - const val anyDigitAndNothingAfter = "\\d(?!\\S)" + const val ANY_DIGIT_AND_NOTHING_AFTER = "\\d(?!\\S)" } }