Skip to content

Commit a8f29e2

Browse files
Fix mockito
Signed-off-by: tobiasKaminsky <[email protected]>
1 parent 2ab9e32 commit a8f29e2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/src/test/java/com/nextcloud/client/logger/ui/LogsViewModelTest.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import org.junit.runner.RunWith
2727
import org.junit.runners.Suite
2828
import org.mockito.MockitoAnnotations
2929
import org.mockito.kotlin.any
30+
import org.mockito.kotlin.anyVararg
3031
import org.mockito.kotlin.mock
3132
import org.mockito.kotlin.whenever
3233
import java.util.Date
@@ -77,7 +78,7 @@ class LogsViewModelTest {
7778

7879
@Before
7980
fun setUpFixture() {
80-
MockitoAnnotations.initMocks(this)
81+
MockitoAnnotations.openMocks(this)
8182
context = mock()
8283
clock = mock()
8384
repository = TestLogRepository()
@@ -204,7 +205,8 @@ class LogsViewModelTest {
204205
@Test
205206
fun `filtered logs are displayed`() {
206207
var statusArgs: Array<Any> = emptyArray()
207-
whenever(context.getString(any(), any())).thenAnswer {
208+
// whenever(context.applicationContext).thenReturn(context)
209+
whenever(context.getString(any(), anyVararg())).thenAnswer {
208210
statusArgs = it.arguments
209211
"${it.arguments}"
210212
}

0 commit comments

Comments
 (0)