Replaces isInstanceOf with assertIs in DataSyncWorkerTest

Issue #2745
This commit is contained in:
Ryan Haining 2023-09-24 22:31:37 -07:00
parent 4f15a26cc6
commit 3e65a1ed80

View file

@ -12,6 +12,7 @@ import dagger.android.AndroidInjector
import dagger.android.HasAndroidInjector import dagger.android.HasAndroidInjector
import info.nightscout.plugins.sync.nsclientV3.DataSyncSelectorV3 import info.nightscout.plugins.sync.nsclientV3.DataSyncSelectorV3
import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin
import kotlin.test.assertIs
import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest import kotlinx.coroutines.test.runTest
import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.BeforeEach
@ -64,6 +65,6 @@ internal class DataSyncWorkerTest : TestBase() {
`when`(nsClient.hasWritePermission).thenReturn(true) `when`(nsClient.hasWritePermission).thenReturn(true)
val result = sut.doWorkAndLog() val result = sut.doWorkAndLog()
Mockito.verify(dataSyncSelectorV3, Mockito.times(1)).doUpload() Mockito.verify(dataSyncSelectorV3, Mockito.times(1)).doUpload()
assertThat(result).isInstanceOf(Success::class.java) assertIs<Success>(result)
} }
} }