From 9cb7bed31a800b0c8c64c20d0dd36e0beb1dae73 Mon Sep 17 00:00:00 2001 From: Ryan Haining Date: Sun, 8 Oct 2023 16:47:00 -0700 Subject: [PATCH] Rewrites ClearPumpAlarmPacketTest with matchers Issue #2745 --- .../pump/medtrum/comm/packets/ClearPumpAlarmPacketTest.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/comm/packets/ClearPumpAlarmPacketTest.kt b/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/comm/packets/ClearPumpAlarmPacketTest.kt index 056cd200f4..6f7faebfa1 100644 --- a/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/comm/packets/ClearPumpAlarmPacketTest.kt +++ b/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/comm/packets/ClearPumpAlarmPacketTest.kt @@ -1,10 +1,10 @@ package info.nightscout.pump.medtrum.comm.packets +import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.pump.medtrum.MedtrumTestBase import info.nightscout.pump.medtrum.extension.toInt -import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test class ClearPumpAlarmPacketTest : MedtrumTestBase() { @@ -29,8 +29,8 @@ class ClearPumpAlarmPacketTest : MedtrumTestBase() { val result = packet.getRequest() // Expected values - Assertions.assertEquals(3, result.size) - Assertions.assertEquals(opCode.toByte(), result[0]) - Assertions.assertEquals(clearCode, result.copyOfRange(1, 3).toInt()) + assertThat(result).hasLength(3) + assertThat(result[0]).isEqualTo(opCode.toByte()) + assertThat(result.copyOfRange(1, 3).toInt()).isEqualTo(clearCode) } }