From f26aba03e5f73dd44de602ebda66e4ef8c367769 Mon Sep 17 00:00:00 2001 From: Ryan Haining Date: Sun, 8 Oct 2023 21:00:56 -0700 Subject: [PATCH] Rewrites SuspendDeliveryCommandTest with matchers Issue #2745 --- .../dash/driver/pod/command/SuspendDeliveryCommandTest.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/SuspendDeliveryCommandTest.kt b/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/SuspendDeliveryCommandTest.kt index ba53dc84b2..8787f2a0f1 100644 --- a/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/SuspendDeliveryCommandTest.kt +++ b/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/SuspendDeliveryCommandTest.kt @@ -1,14 +1,13 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command +import com.google.common.truth.Truth.assertThat import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.BeepType -import org.apache.commons.codec.DecoderException import org.apache.commons.codec.binary.Hex -import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test class SuspendDeliveryCommandTest { - @Test @Throws(DecoderException::class) fun testSuspendDelivery() { + @Test fun testSuspendDelivery() { val encoded = SuspendDeliveryCommand.Builder() .setUniqueId(37879811) .setSequenceNumber(0.toShort()) @@ -16,6 +15,6 @@ class SuspendDeliveryCommandTest { .setBeepType(BeepType.LONG_SINGLE_BEEP) .build() .encoded - Assertions.assertArrayEquals(Hex.decodeHex("0242000300131f05494e532e67190a494e532e680000140302811f"), encoded) + assertThat(encoded).asList().containsExactlyElementsIn(Hex.decodeHex("0242000300131f05494e532e67190a494e532e680000140302811f").asList()).inOrder() } }