diff --git a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/Providers.kt b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/Providers.kt index 5d97588ca63b..d3c6aacba98e 100644 --- a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/Providers.kt +++ b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/model/Providers.kt @@ -3,4 +3,7 @@ package net.mullvad.mullvadvpn.model import android.os.Parcelable import kotlinx.parcelize.Parcelize -@JvmInline @Parcelize value class Providers(val providers: HashSet) : Parcelable +@Suppress("ensure value classes property is named value") +@JvmInline +@Parcelize +value class Providers(val providers: HashSet) : Parcelable diff --git a/android/lib/payment/src/main/kotlin/net/mullvad/mullvadvpn/lib/payment/PaymentProvider.kt b/android/lib/payment/src/main/kotlin/net/mullvad/mullvadvpn/lib/payment/PaymentProvider.kt index 431b406dc0a0..1d2b3f20b8fb 100644 --- a/android/lib/payment/src/main/kotlin/net/mullvad/mullvadvpn/lib/payment/PaymentProvider.kt +++ b/android/lib/payment/src/main/kotlin/net/mullvad/mullvadvpn/lib/payment/PaymentProvider.kt @@ -1,3 +1,3 @@ package net.mullvad.mullvadvpn.lib.payment -@JvmInline value class PaymentProvider(val paymentRepository: PaymentRepository?) +data class PaymentProvider(val paymentRepository: PaymentRepository?) diff --git a/android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/classes/ValueClassTests.kt b/android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/classes/ValueClassTests.kt new file mode 100644 index 000000000000..6b40e051e868 --- /dev/null +++ b/android/test/arch/src/test/kotlin/net/mullvad/mullvadvpn/test/arch/classes/ValueClassTests.kt @@ -0,0 +1,18 @@ +package net.mullvad.mullvadvpn.test.arch.classes + +import com.lemonappdev.konsist.api.Konsist +import com.lemonappdev.konsist.api.ext.list.modifierprovider.withValueModifier +import com.lemonappdev.konsist.api.ext.list.properties +import com.lemonappdev.konsist.api.verify.assertTrue +import org.junit.Test + +class ValueClassTests { + @Test + fun `ensure value classes property is named value`() { + Konsist.scopeFromProject().classes(includeNested = true).withValueModifier().assertTrue { + it.properties(includeNested = false, includeLocal = false).firstOrNull { property -> + property.name == "value" + } != null + } + } +}