Skip to content

Commit 5f647b7

Browse files
committed
Move GetDelayUntil tests to dav4jvm
1 parent d460e4c commit 5f647b7

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

app/src/androidTest/kotlin/at/bitfire/davdroid/sync/SyncManagerTest.kt

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -96,30 +96,6 @@ class SyncManagerTest {
9696
}
9797

9898

99-
@Test
100-
fun testGetDelayUntil_defaultOnNull() {
101-
val now = Instant.now()
102-
val delayUntil = SyncManager.getDelayUntil(null).epochSecond
103-
val default = now.plusSeconds(SyncManager.DELAY_UNTIL_DEFAULT).epochSecond
104-
assertWithin(default, delayUntil, 5)
105-
}
106-
107-
@Test
108-
fun testGetDelayUntil_reducesToMax() {
109-
val now = Instant.now()
110-
val delayUntil = SyncManager.getDelayUntil(now.plusSeconds(10*24*60*60)).epochSecond
111-
val max = now.plusSeconds(SyncManager.DELAY_UNTIL_MAX).epochSecond
112-
assertWithin(max, delayUntil, 5)
113-
}
114-
115-
@Test
116-
fun testGetDelayUntil_increasesToMin() {
117-
val delayUntil = SyncManager.getDelayUntil(Instant.EPOCH).epochSecond
118-
val min = Instant.now().plusSeconds(SyncManager.DELAY_UNTIL_MIN).epochSecond
119-
assertWithin(min, delayUntil, 5)
120-
}
121-
122-
12399
private fun queryCapabilitiesResponse(cTag: String? = null): MockResponse {
124100
val body = StringBuilder()
125101
body.append(
@@ -144,6 +120,7 @@ class SyncManagerTest {
144120
.setBody(body.toString())
145121
}
146122

123+
147124
@Test
148125
fun testPerformSync_503RetryAfter_DelaySeconds() {
149126
server.enqueue(MockResponse()

0 commit comments

Comments
 (0)