diff --git a/app/build.gradle b/app/build.gradle index d6f95e988..4a1743c74 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -204,7 +204,7 @@ dependencies { implementation 'androidx.camera:camera-view:1.2.3' implementation 'androidx.camera:camera-lifecycle:1.2.3' testImplementation "junit:junit:4.13.2" - testImplementation "org.mockito:mockito-core:2.28.2" + testImplementation "org.mockito:mockito-core:5.12.0" testImplementation "org.robolectric:robolectric:4.12.2" testImplementation "org.hamcrest:hamcrest-library:2.2" testImplementation "com.google.code.gson:gson:2.8.9" diff --git a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huawei/TestResponseManager.java b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huawei/TestResponseManager.java index dcc210b60..745e04697 100644 --- a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huawei/TestResponseManager.java +++ b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huawei/TestResponseManager.java @@ -16,7 +16,7 @@ along with this program. If not, see . */ package nodomain.freeyourgadget.gadgetbridge.service.devices.huawei; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -29,7 +29,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import java.io.IOException; import java.lang.reflect.Field; diff --git a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/devices/withingssteelhr/communication/MessageBuilderTest.java b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/devices/withingssteelhr/communication/MessageBuilderTest.java index 14d2c537f..a3bf285df 100644 --- a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/devices/withingssteelhr/communication/MessageBuilderTest.java +++ b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/service/devices/withingssteelhr/communication/MessageBuilderTest.java @@ -6,7 +6,7 @@ import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.when; import org.junit.Before; @@ -49,7 +49,7 @@ public class MessageBuilderTest { // assert; assertFalse(result); - verifyZeroInteractions(supportMock); + verifyNoInteractions(supportMock); } @Test @@ -64,7 +64,7 @@ public class MessageBuilderTest { // assert; assertTrue(result); verify(messageFactoryMock, times(1)).createMessageFromRawData(data); - verifyZeroInteractions(supportMock); + verifyNoInteractions(supportMock); } @Test @@ -79,7 +79,7 @@ public class MessageBuilderTest { // assert; assertFalse(result); verify(messageFactoryMock, never()).createMessageFromRawData(data); - verifyZeroInteractions(supportMock); + verifyNoInteractions(supportMock); } @Test @@ -100,7 +100,7 @@ public class MessageBuilderTest { verify(messageFactoryMock, never()).createMessageFromRawData(data1); verify(messageFactoryMock, never()).createMessageFromRawData(data2); verify(messageFactoryMock, times(1)).createMessageFromRawData(dataComplete); - verifyZeroInteractions(supportMock); + verifyNoInteractions(supportMock); } @Test @@ -121,7 +121,7 @@ public class MessageBuilderTest { verify(messageFactoryMock, never()).createMessageFromRawData(data1); verify(messageFactoryMock, never()).createMessageFromRawData(data2); verify(messageFactoryMock, times(1)).createMessageFromRawData(dataComplete); - verifyZeroInteractions(supportMock); + verifyNoInteractions(supportMock); } @Test