SyncFreshStartResetterTest.kt

1.1 KB · raw

1package com.peachpasswords.sync23import org.junit.Assert.assertEquals4import org.junit.Test56class SyncFreshStartResetterTest {7    @Test fun fresh_start_stops_the_service_then_clears_every_sync_state_store() {8        val calls = mutableListOf<String>()910        resetSyncStateForFreshStart(11            stopService = { calls += "service" },12            clearDevices = { calls += "devices" },13            clearPendingDevices = { calls += "pending" },14            clearAlerts = { calls += "alerts" },15            clearOutcomes = { calls += "outcomes" },16            clearRelaySettings = { calls += "relay" },17            clearBackgroundPreference = { calls += "background" },18            clearLocalIdentity = { calls += "identity" },19            clearLockedSyncSpool = { calls += "spool" },20        )2122        assertEquals(23            listOf(24                "service",25                "devices",26                "pending",27                "alerts",28                "outcomes",29                "relay",30                "background",31                "identity",32                "spool",33            ),34            calls,35        )36    }37}