Rewrites SuspendDeliveryCommandTest with matchers

Issue #2745
This commit is contained in:
Ryan Haining 2023-10-08 21:00:56 -07:00
parent 5139242bc1
commit f26aba03e5

View file

@ -1,14 +1,13 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command 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 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.apache.commons.codec.binary.Hex
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test import org.junit.jupiter.api.Test
class SuspendDeliveryCommandTest { class SuspendDeliveryCommandTest {
@Test @Throws(DecoderException::class) fun testSuspendDelivery() { @Test fun testSuspendDelivery() {
val encoded = SuspendDeliveryCommand.Builder() val encoded = SuspendDeliveryCommand.Builder()
.setUniqueId(37879811) .setUniqueId(37879811)
.setSequenceNumber(0.toShort()) .setSequenceNumber(0.toShort())
@ -16,6 +15,6 @@ class SuspendDeliveryCommandTest {
.setBeepType(BeepType.LONG_SINGLE_BEEP) .setBeepType(BeepType.LONG_SINGLE_BEEP)
.build() .build()
.encoded .encoded
Assertions.assertArrayEquals(Hex.decodeHex("0242000300131f05494e532e67190a494e532e680000140302811f"), encoded) assertThat(encoded).asList().containsExactlyElementsIn(Hex.decodeHex("0242000300131f05494e532e67190a494e532e680000140302811f").asList()).inOrder()
} }
} }