From 3d384c7db561df90d339108e7fc131fe267d4795 Mon Sep 17 00:00:00 2001 From: Ryan Haining Date: Fri, 8 Sep 2023 19:52:47 -0700 Subject: [PATCH] Rewrites PodInfoDataLogTest with matchers Issue #2745 --- .../response/podinfo/PodInfoDataLogTest.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDataLogTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDataLogTest.java index 2e5f99f6c3..2f1211ea9f 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDataLogTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDataLogTest.java @@ -1,9 +1,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo; -import org.joda.time.Duration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; +import static com.google.common.truth.Truth.assertThat; +import org.joda.time.Duration; +import org.junit.jupiter.api.Test; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode; import info.nightscout.pump.core.utils.ByteUtil; @@ -12,10 +12,10 @@ class PodInfoDataLogTest { void testDecoding() { PodInfoDataLog podInfoDataLog = new PodInfoDataLog(ByteUtil.fromHexString("030100010001043c"), 8); // From https://github.com/ps2/rileylink_ios/blob/omnipod-testing/OmniKitTests/PodInfoTests.swift - Assertions.assertEquals(FaultEventCode.FAILED_FLASH_ERASE, podInfoDataLog.getFaultEventCode()); - Assertions.assertTrue(Duration.standardMinutes(1).isEqual(podInfoDataLog.getTimeFaultEvent())); - Assertions.assertTrue(Duration.standardMinutes(1).isEqual(podInfoDataLog.getTimeSinceActivation())); - Assertions.assertEquals(4, podInfoDataLog.getDataChunkSize()); - Assertions.assertEquals(60, podInfoDataLog.getMaximumNumberOfDwords()); + assertThat(podInfoDataLog.getFaultEventCode()).isEqualTo(FaultEventCode.FAILED_FLASH_ERASE); + assertThat(podInfoDataLog.getTimeFaultEvent()).isEqualTo(Duration.standardMinutes(1)); + assertThat(podInfoDataLog.getTimeSinceActivation()).isEqualTo(Duration.standardMinutes(1)); + assertThat(podInfoDataLog.getDataChunkSize()).isEqualTo(4); + assertThat(podInfoDataLog.getMaximumNumberOfDwords()).isEqualTo(60); } }