From 1d3c697caa001b06401f3d2595cd4c78cfab3084 Mon Sep 17 00:00:00 2001 From: Ryan Haining Date: Sun, 8 Oct 2023 21:00:48 -0700 Subject: [PATCH] Rewrites SilenceAlertsCommandTest with matchers Issue #2745 --- .../dash/driver/pod/command/SilenceAlertsCommandTest.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/SilenceAlertsCommandTest.kt b/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/SilenceAlertsCommandTest.kt index 64884e99dc..8360adddba 100644 --- a/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/SilenceAlertsCommandTest.kt +++ b/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/SilenceAlertsCommandTest.kt @@ -1,15 +1,14 @@ 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.AlertType -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 import java.util.EnumSet class SilenceAlertsCommandTest { - @Test @Throws(DecoderException::class) fun testSilenceLowReservoirAlert() { + @Test fun testSilenceLowReservoirAlert() { val encoded = SilenceAlertsCommand.Builder() .setUniqueId(37879811) .setSequenceNumber(1.toShort()) @@ -18,7 +17,7 @@ class SilenceAlertsCommandTest { .build() .encoded - Assertions.assertArrayEquals(Hex.decodeHex("0242000304071105494E532E1081CE"), encoded) + assertThat(encoded).asList().containsExactlyElementsIn(Hex.decodeHex("0242000304071105494E532E1081CE").asList()).inOrder() } // TODO capture more silence alerts commands