From d44367a17049874488975e65fe0901a1dea483a2 Mon Sep 17 00:00:00 2001 From: Ryan Haining Date: Sun, 8 Oct 2023 20:42:55 -0700 Subject: [PATCH] Rewrites DeactivateCommandTest with matchers Issue #2745 --- .../dash/driver/pod/command/DeactivateCommandTest.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/DeactivateCommandTest.kt b/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/DeactivateCommandTest.kt index 1c74df813f..db10dc0d41 100644 --- a/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/DeactivateCommandTest.kt +++ b/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/command/DeactivateCommandTest.kt @@ -1,13 +1,12 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command -import org.apache.commons.codec.DecoderException +import com.google.common.truth.Truth.assertThat import org.apache.commons.codec.binary.Hex -import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test class DeactivateCommandTest { - @Test @Throws(DecoderException::class) fun testEncoding() { + @Test fun testEncoding() { val encoded = DeactivateCommand.Builder() .setUniqueId(37879809) .setSequenceNumber(5.toShort()) @@ -15,6 +14,6 @@ class DeactivateCommandTest { .build() .encoded - Assertions.assertArrayEquals(Hex.decodeHex("0242000114061C04494E532E001C"), encoded) + assertThat(encoded).asList().containsExactlyElementsIn(Hex.decodeHex("0242000114061C04494E532E001C").asList()).inOrder() } }