Do not use deprecated mockito api
authorVitaliy.Bibaev <vitaliy.bibaev@jetbrains.com>
Tue, 19 Dec 2017 09:04:42 +0000 (12:04 +0300)
committerVitaliy.Bibaev <vitaliy.bibaev@jetbrains.com>
Tue, 19 Dec 2017 09:04:42 +0000 (12:04 +0300)
plugins/stats-collector/test/com/intellij/stats/completion/FileLoggerTest.kt
plugins/stats-collector/test/com/intellij/stats/completion/PerformanceTests.kt
plugins/stats-collector/test/com/intellij/stats/experiment/StatusInfoProviderTest.kt

index db9eb191a6401abeb53c0d9c4296457360eae54f..b485d45fe32e101ab5e8f29d643fa1608a367a5d 100644 (file)
@@ -21,7 +21,7 @@ import com.intellij.stats.storage.FilePathProvider
 import com.intellij.testFramework.PlatformTestCase
 import org.assertj.core.api.Assertions.assertThat
 import org.junit.Test
-import org.mockito.Matchers
+import org.mockito.ArgumentMatchers
 import org.mockito.Mockito.`when`
 import org.mockito.Mockito.mock
 import java.io.File
@@ -70,7 +70,7 @@ class FileLoggerTest : PlatformTestCase() {
         val logger = loggerProvider.newCompletionLogger()
         
         val lookup = mock(LookupImpl::class.java).apply {
-            `when`(getRelevanceObjects(Matchers.any(), Matchers.anyBoolean())).thenReturn(emptyMap())
+            `when`(getRelevanceObjects(ArgumentMatchers.any(), ArgumentMatchers.anyBoolean())).thenReturn(emptyMap())
             `when`(items).thenReturn(emptyList())
             `when`(psiFile).thenReturn(null)
             `when`(editor).thenReturn(mock(Editor::class.java))
index aa584ba4d3599ecaaf7708a928aa96c1abbd5a76..7067bbf4b2a62776172b9af307a093b7fefa3196 100644 (file)
@@ -22,7 +22,7 @@ import com.intellij.stats.network.service.ResponseData
 import com.intellij.stats.sender.StatisticSenderImpl
 import com.intellij.stats.storage.FilePathProvider
 import com.intellij.testFramework.UsefulTestCase
-import org.mockito.Matchers
+import org.mockito.ArgumentMatchers
 import org.mockito.Mockito.*
 import org.picocontainer.MutablePicoContainer
 import java.io.File
@@ -97,7 +97,7 @@ class Test {
                 ResponseData(200)
             }
 
-            `when`(post(Matchers.anyString(), anyMapOf(String::class.java, String::class.java))).then {
+            `when`(post(ArgumentMatchers.anyString(), ArgumentMatchers.anyMap<String, String>())).then {
                 Thread.sleep(1000)
                 ResponseData(200)
             }
index 0294636f8e9ecac6d5f568bee14539d2802ca51e..05b16d1a39ba88f895e5d9153079539f7bdd610f 100644 (file)
@@ -19,7 +19,7 @@ import com.intellij.stats.network.service.RequestService
 import com.intellij.stats.network.service.ResponseData
 import com.intellij.testFramework.LightIdeaTestCase
 import org.assertj.core.api.Assertions.assertThat
-import org.mockito.Matchers
+import org.mockito.ArgumentMatchers
 import org.mockito.Mockito.`when`
 import org.mockito.Mockito.mock
 
@@ -72,7 +72,7 @@ class StatusInfoProviderTest : LightIdeaTestCase() {
 
     private fun getProvider(response: String): WebServiceStatus {
         val requestSender = mock(RequestService::class.java).apply {
-            `when`(get(Matchers.anyString())).thenReturn(ResponseData(200, response))
+            `when`(get(ArgumentMatchers.anyString())).thenReturn(ResponseData(200, response))
         }
         val decision = mock(ExperimentDecision::class.java)
         return WebServiceStatusProvider(requestSender, decision)