diff --git a/vector/src/test/java/im/vector/app/SpaceStateHandlerImplTest.kt b/vector/src/test/java/im/vector/app/SpaceStateHandlerImplTest.kt index f47f5ea9bf..36d372cfac 100644 --- a/vector/src/test/java/im/vector/app/SpaceStateHandlerImplTest.kt +++ b/vector/src/test/java/im/vector/app/SpaceStateHandlerImplTest.kt @@ -22,12 +22,10 @@ import im.vector.app.test.fakes.FakeAnalyticsTracker import im.vector.app.test.fakes.FakeSession import im.vector.app.test.fakes.FakeUiStateRepository import im.vector.app.test.fixtures.RoomSummaryFixture.aRoomSummary -import io.mockk.justRun import kotlinx.coroutines.flow.first import kotlinx.coroutines.test.runTest import org.amshove.kluent.shouldBe import org.amshove.kluent.shouldBeEqualTo -import org.junit.Before import org.junit.Test internal class SpaceStateHandlerImplTest { @@ -48,11 +46,6 @@ internal class SpaceStateHandlerImplTest { analyticsTracker, ) - @Before - fun setup() { - justRun { uiStateRepository.storeSelectedSpace(any(), any()) } - } - @Test fun `given selected space doesn't exist, when getCurrentSpace, then return null`() { val currentSpace = spaceStateHandler.getCurrentSpace() diff --git a/vector/src/test/java/im/vector/app/test/fakes/FakeUiStateRepository.kt b/vector/src/test/java/im/vector/app/test/fakes/FakeUiStateRepository.kt index 3b38e4512c..4e8af9042c 100644 --- a/vector/src/test/java/im/vector/app/test/fakes/FakeUiStateRepository.kt +++ b/vector/src/test/java/im/vector/app/test/fakes/FakeUiStateRepository.kt @@ -17,12 +17,17 @@ package im.vector.app.test.fakes import im.vector.app.features.ui.UiStateRepository +import io.mockk.justRun import io.mockk.mockk import io.mockk.verify import org.matrix.android.sdk.api.session.Session class FakeUiStateRepository : UiStateRepository by mockk() { + init { + justRun { storeSelectedSpace(any(), any()) } + } + fun verifyStoreSelectedSpace(roomId: String, session: Session, inverse: Boolean = false) { verify(inverse = inverse) { storeSelectedSpace(roomId, session.sessionId) } }