diff --git a/demo-app/build.gradle b/demo-app/build.gradle index 8044aba5..9f7f4595 100644 --- a/demo-app/build.gradle +++ b/demo-app/build.gradle @@ -89,7 +89,7 @@ dependencies { testImplementation 'junit:junit:4.13' testImplementation 'com.github.java-json-tools:json-schema-validator:2.2.10' - testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0" + testImplementation "org.mockito.kotlin:mockito-kotlin:4.1.0" androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation 'androidx.test:rules:1.5.0' diff --git a/demo-app/src/test/java/com/worldpay/access/checkout/sample/images/SVGImageLoaderTest.kt b/demo-app/src/test/java/com/worldpay/access/checkout/sample/images/SVGImageLoaderTest.kt index 28b54d49..2415d33f 100644 --- a/demo-app/src/test/java/com/worldpay/access/checkout/sample/images/SVGImageLoaderTest.kt +++ b/demo-app/src/test/java/com/worldpay/access/checkout/sample/images/SVGImageLoaderTest.kt @@ -3,9 +3,6 @@ package com.worldpay.access.checkout.sample.images import android.app.Activity import android.content.res.Resources import android.widget.ImageView -import com.nhaarman.mockitokotlin2.any -import com.nhaarman.mockitokotlin2.argumentCaptor -import com.nhaarman.mockitokotlin2.given import com.worldpay.access.checkout.client.validation.model.CardBrand import com.worldpay.access.checkout.client.validation.model.CardBrandImage import com.worldpay.access.checkout.sample.R @@ -21,14 +18,22 @@ import org.junit.Before import org.junit.Test import org.mockito.Mockito.mock import org.mockito.Mockito.verify -import org.mockito.Mockito.verifyZeroInteractions +import org.mockito.kotlin.any +import org.mockito.kotlin.argumentCaptor +import org.mockito.kotlin.given +import org.mockito.kotlin.verifyNoInteractions class SVGImageLoaderTest { private val cardBrand = CardBrand( name = "visa", - images = listOf(CardBrandImage(type = "image/svg+xml", url = "https://localhost:8443/test.svg")) + images = listOf( + CardBrandImage( + type = "image/svg+xml", + url = "https://localhost:8443/test.svg" + ) + ) ) private lateinit var activity: Activity @@ -83,7 +88,7 @@ class SVGImageLoaderTest { svgImageLoader.fetchAndApplyCardLogo(null, targetImageView) - verifyZeroInteractions(client) + verifyNoInteractions(client) verify(targetImageView).setImageResource(R.drawable.card_unknown_logo) verify(targetImageView).setTag(R.integer.card_tag, "card_unknown_logo") @@ -94,7 +99,12 @@ class SVGImageLoaderTest { val cardBrandWithNoSVG = CardBrand( name = "visa", - images = listOf(CardBrandImage(type = "image/png", url = "https://localhost:8443/test.png")) + images = listOf( + CardBrandImage( + type = "image/png", + url = "https://localhost:8443/test.png" + ) + ) ) val mockHttpCall = mock(Call::class.java) @@ -112,7 +122,7 @@ class SVGImageLoaderTest { svgImageLoader.fetchAndApplyCardLogo(cardBrandWithNoSVG, targetImageView) - verifyZeroInteractions(client) + verifyNoInteractions(client) verify(targetImageView).setImageResource(R.drawable.card_unknown_logo) verify(targetImageView).setTag(R.integer.card_tag, "card_unknown_logo") } @@ -136,7 +146,7 @@ class SVGImageLoaderTest { // Trigger onFailure callback function captor.firstValue.onFailure(mockHttpCall, IOException("some message")) - verifyZeroInteractions(svgImageRenderer) - verifyZeroInteractions(targetImageView) + verifyNoInteractions(svgImageRenderer) + verifyNoInteractions(targetImageView) } } diff --git a/demo-app/src/test/java/com/worldpay/access/checkout/sample/images/SVGImageRendererImplTest.kt b/demo-app/src/test/java/com/worldpay/access/checkout/sample/images/SVGImageRendererImplTest.kt index 3ee11220..d0b17bf6 100644 --- a/demo-app/src/test/java/com/worldpay/access/checkout/sample/images/SVGImageRendererImplTest.kt +++ b/demo-app/src/test/java/com/worldpay/access/checkout/sample/images/SVGImageRendererImplTest.kt @@ -6,8 +6,8 @@ import android.graphics.drawable.PictureDrawable import android.view.View import android.widget.ImageView import com.caverock.androidsvg.SVG -import com.nhaarman.mockitokotlin2.argumentCaptor -import com.nhaarman.mockitokotlin2.verifyZeroInteractions +import org.mockito.kotlin.argumentCaptor +import org.mockito.kotlin.verifyNoInteractions import com.worldpay.access.checkout.sample.R import java.io.InputStream import org.junit.Before @@ -64,6 +64,6 @@ class SVGImageRendererImplTest { svgImageRenderer.renderImage(mockInputStream, target, "someName") - verifyZeroInteractions(target) + verifyNoInteractions(target) } }