Rewrites PodInfoDataLogTest with matchers

Issue #2745
This commit is contained in:
Ryan Haining 2023-09-08 19:52:47 -07:00
parent 19d2f9635a
commit 3d384c7db5

View file

@ -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);
}
}