summaryrefslogtreecommitdiffhomepage
path: root/android/app/src/androidTest
diff options
context:
space:
mode:
authorKalle Lindström <karl.lindstrom@mullvad.net>2025-02-25 10:48:50 +0100
committerKalle Lindström <karl.lindstrom@mullvad.net>2025-02-26 09:25:17 +0100
commitda304ffedf8f8d98600f31f737cf92768c0323fa (patch)
treee8da9b9a861f3d3efbbbc39fb5160ec1cfeb67fa /android/app/src/androidTest
parent5025db74b34cfb3536c43f89f3407ffc0d97ae73 (diff)
downloadmullvadvpn-da304ffedf8f8d98600f31f737cf92768c0323fa.tar.xz
mullvadvpn-da304ffedf8f8d98600f31f737cf92768c0323fa.zip
Remove Joda Time and use java.time package instead
Joda Time has been superseded by the Java 8 java.time package which has more or less the same API. This commit removes all usage of Joda Time and replaces it with the java.time classes. This is done so that we can remove the dependency on Joda Time.
Diffstat (limited to 'android/app/src/androidTest')
-rw-r--r--android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreenTest.kt17
1 files changed, 11 insertions, 6 deletions
diff --git a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreenTest.kt b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreenTest.kt
index 0cdc8b8fe7..f1a81d4d91 100644
--- a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreenTest.kt
+++ b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreenTest.kt
@@ -10,6 +10,9 @@ import io.mockk.every
import io.mockk.mockk
import io.mockk.unmockkAll
import io.mockk.verify
+import java.time.Duration
+import java.time.Instant
+import java.time.ZonedDateTime
import net.mullvad.mullvadvpn.compose.createEdgeToEdgeComposeExtension
import net.mullvad.mullvadvpn.compose.setContentWithTheme
import net.mullvad.mullvadvpn.compose.state.ConnectUiState
@@ -30,8 +33,6 @@ import net.mullvad.mullvadvpn.lib.model.TunnelEndpoint
import net.mullvad.mullvadvpn.lib.model.TunnelState
import net.mullvad.mullvadvpn.repository.InAppNotification
import net.mullvad.mullvadvpn.ui.VersionInfo
-import org.joda.time.DateTime
-import org.joda.time.Duration
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
@@ -556,7 +557,7 @@ class ConnectScreenTest {
fun testAccountExpiredNotification() {
composeExtension.use {
// Arrange
- val expiryDate = DateTime(2020, 11, 11, 10, 10)
+ val expiryDate = ZonedDateTime.parse("2020-11-11T10:10Z")
initScreen(
state =
ConnectUiState(
@@ -567,7 +568,9 @@ class ConnectScreenTest {
deviceName = "",
daysLeftUntilExpiry = null,
inAppNotification =
- InAppNotification.AccountExpiry(Duration(DateTime.now(), expiryDate)),
+ InAppNotification.AccountExpiry(
+ Duration.between(Instant.now(), expiryDate)
+ ),
isPlayBuild = false,
)
)
@@ -612,7 +615,7 @@ class ConnectScreenTest {
composeExtension.use {
// Arrange
val mockedClickHandler: () -> Unit = mockk(relaxed = true)
- val expiryDate = DateTime(2020, 11, 11, 10, 10)
+ val expiryDate = ZonedDateTime.parse("2020-11-11T10:10Z")
initScreen(
onManageAccountClick = mockedClickHandler,
state =
@@ -624,7 +627,9 @@ class ConnectScreenTest {
deviceName = "",
daysLeftUntilExpiry = null,
inAppNotification =
- InAppNotification.AccountExpiry(Duration(DateTime.now(), expiryDate)),
+ InAppNotification.AccountExpiry(
+ Duration.between(Instant.now(), expiryDate)
+ ),
isPlayBuild = false,
),
)