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)" } }