Replaces PodInfoResponseTest assertThrows with an isNotInstance

Related to #2745
This commit is contained in:
Ryan Haining 2023-09-23 16:48:06 -07:00
parent 88c38b8049
commit de5040a983

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo
import com.google.common.truth.Truth.assertThat
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType
import info.nightscout.pump.common.utils.ByteUtil import info.nightscout.pump.common.utils.ByteUtil
import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Assertions
@ -31,8 +32,6 @@ internal class PodInfoResponseTest {
@Test fun testInvalidPodInfoTypeMessageDecoding() { @Test fun testInvalidPodInfoTypeMessageDecoding() {
val podInfoResponse = PodInfoResponse(ByteUtil.fromHexString("0216020d0000000000ab6a038403ff03860000285708030d")) val podInfoResponse = PodInfoResponse(ByteUtil.fromHexString("0216020d0000000000ab6a038403ff03860000285708030d"))
Assertions.assertEquals(PodInfoType.DETAILED_STATUS, podInfoResponse.subType) Assertions.assertEquals(PodInfoType.DETAILED_STATUS, podInfoResponse.subType)
Assertions.assertThrows(ClassCastException::class.java) { assertThat(podInfoResponse.podInfo).isNotInstanceOf(PodInfoActiveAlerts::class.java)
@Suppress("UNUSED_VARIABLE") val podInfo = podInfoResponse.podInfo as PodInfoActiveAlerts
}
} }
} }