Cleanup tests.
This commit is contained in:
@@ -20,12 +20,12 @@ import org.junit.Test
|
||||
class AppMigration02Test {
|
||||
@Test
|
||||
fun `test migration`() = runTest {
|
||||
val sessionStore = InMemorySessionStore().apply {
|
||||
updateData(aSessionData())
|
||||
}
|
||||
val sessionStore = InMemorySessionStore(
|
||||
initialList = listOf(aSessionData()),
|
||||
)
|
||||
val sessionPreferencesStore = InMemorySessionPreferencesStore(isSessionVerificationSkipped = false)
|
||||
val sessionPreferencesStoreFactory = FakeSessionPreferencesStoreFactory(
|
||||
getLambda = lambdaRecorder { _, _, -> sessionPreferencesStore },
|
||||
getLambda = lambdaRecorder { _, _ -> sessionPreferencesStore },
|
||||
removeLambda = lambdaRecorder { _ -> }
|
||||
)
|
||||
val migration = AppMigration02(sessionStore = sessionStore, sessionPreferenceStoreFactory = sessionPreferencesStoreFactory)
|
||||
|
||||
@@ -18,14 +18,14 @@ import java.io.File
|
||||
class AppMigration05Test {
|
||||
@Test
|
||||
fun `empty session path should be set to an expected path`() = runTest {
|
||||
val sessionStore = InMemorySessionStore().apply {
|
||||
updateData(
|
||||
val sessionStore = InMemorySessionStore(
|
||||
initialList = listOf(
|
||||
aSessionData(
|
||||
sessionId = A_SESSION_ID.value,
|
||||
sessionPath = "",
|
||||
)
|
||||
)
|
||||
}
|
||||
)
|
||||
val migration = AppMigration05(sessionStore = sessionStore, baseDirectory = File("/a/path"))
|
||||
migration.migrate()
|
||||
val storedData = sessionStore.getSession(A_SESSION_ID.value)!!
|
||||
@@ -34,14 +34,14 @@ class AppMigration05Test {
|
||||
|
||||
@Test
|
||||
fun `non empty session path should not be impacted by the migration`() = runTest {
|
||||
val sessionStore = InMemorySessionStore().apply {
|
||||
updateData(
|
||||
val sessionStore = InMemorySessionStore(
|
||||
initialList = listOf(
|
||||
aSessionData(
|
||||
sessionId = A_SESSION_ID.value,
|
||||
sessionPath = "/a/path/existing",
|
||||
)
|
||||
)
|
||||
}
|
||||
)
|
||||
val migration = AppMigration05(sessionStore = sessionStore, baseDirectory = File("/a/path"))
|
||||
migration.migrate()
|
||||
val storedData = sessionStore.getSession(A_SESSION_ID.value)!!
|
||||
|
||||
@@ -18,15 +18,15 @@ import java.io.File
|
||||
class AppMigration06Test {
|
||||
@Test
|
||||
fun `empty cache path should be set to an expected path`() = runTest {
|
||||
val sessionStore = InMemorySessionStore().apply {
|
||||
updateData(
|
||||
val sessionStore = InMemorySessionStore(
|
||||
initialList = listOf(
|
||||
aSessionData(
|
||||
sessionId = A_SESSION_ID.value,
|
||||
sessionPath = "/a/path/to/a/session/AN_ID",
|
||||
cachePath = "",
|
||||
)
|
||||
)
|
||||
}
|
||||
)
|
||||
val migration = AppMigration06(sessionStore = sessionStore, cacheDirectory = File("/a/path/cache"))
|
||||
migration.migrate()
|
||||
val storedData = sessionStore.getSession(A_SESSION_ID.value)!!
|
||||
@@ -35,14 +35,14 @@ class AppMigration06Test {
|
||||
|
||||
@Test
|
||||
fun `non empty cache path should not be impacted by the migration`() = runTest {
|
||||
val sessionStore = InMemorySessionStore().apply {
|
||||
updateData(
|
||||
val sessionStore = InMemorySessionStore(
|
||||
initialList = listOf(
|
||||
aSessionData(
|
||||
sessionId = A_SESSION_ID.value,
|
||||
cachePath = "/a/path/existing",
|
||||
)
|
||||
)
|
||||
}
|
||||
)
|
||||
val migration = AppMigration05(sessionStore = sessionStore, baseDirectory = File("/a/path/cache"))
|
||||
migration.migrate()
|
||||
val storedData = sessionStore.getSession(A_SESSION_ID.value)!!
|
||||
|
||||
Reference in New Issue
Block a user