Rewrites GetVersionCommandTest with matchers

Issue #2745
This commit is contained in:
Ryan Haining 2023-10-08 20:43:09 -07:00
parent d44367a170
commit 77964df4ae

View file

@ -1,19 +1,18 @@
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command 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.apache.commons.codec.binary.Hex
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test import org.junit.jupiter.api.Test
class GetVersionCommandTest { class GetVersionCommandTest {
@Test @Throws(DecoderException::class) fun testEncoding() { @Test fun testEncoding() {
val encoded = GetVersionCommand.Builder() val encoded = GetVersionCommand.Builder()
.setSequenceNumber(0.toShort()) .setSequenceNumber(0.toShort())
.setUniqueId(GetVersionCommand.DEFAULT_UNIQUE_ID) .setUniqueId(GetVersionCommand.DEFAULT_UNIQUE_ID)
.build() .build()
.encoded .encoded
Assertions.assertArrayEquals(Hex.decodeHex("FFFFFFFF00060704FFFFFFFF82B2"), encoded) assertThat(encoded).asList().containsExactlyElementsIn(Hex.decodeHex("FFFFFFFF00060704FFFFFFFF82B2").asList()).inOrder()
} }
} }