From 5cf17a432f344e56755957a9f4185e03265aedaa Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 23 May 2023 12:46:05 +0200 Subject: [PATCH] Init the mockked Bitmap only once. --- .../impl/detection/RageshakeDetectionPresenterTest.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/features/rageshake/impl/src/test/kotlin/io/element/android/features/rageshake/impl/detection/RageshakeDetectionPresenterTest.kt b/features/rageshake/impl/src/test/kotlin/io/element/android/features/rageshake/impl/detection/RageshakeDetectionPresenterTest.kt index 55482c2526..eb49eb450e 100644 --- a/features/rageshake/impl/src/test/kotlin/io/element/android/features/rageshake/impl/detection/RageshakeDetectionPresenterTest.kt +++ b/features/rageshake/impl/src/test/kotlin/io/element/android/features/rageshake/impl/detection/RageshakeDetectionPresenterTest.kt @@ -31,11 +31,20 @@ import io.element.android.libraries.matrix.test.AN_EXCEPTION import io.mockk.mockk import kotlinx.coroutines.flow.first import kotlinx.coroutines.test.runTest +import org.junit.BeforeClass import org.junit.Test class RageshakeDetectionPresenterTest { - private val aBitmap: Bitmap = mockk() + companion object { + private lateinit var aBitmap: Bitmap + + @BeforeClass + @JvmStatic + fun initBitmap() { + aBitmap = mockk() + } + } @Test fun `present - initial state`() = runTest {