parent
feb75829ee
commit
d71805b85b
|
@ -2,8 +2,8 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.endecry
|
||||||
|
|
||||||
import app.aaps.core.utils.toHex
|
import app.aaps.core.utils.toHex
|
||||||
import app.aaps.shared.tests.AAPSLoggerTest
|
import app.aaps.shared.tests.AAPSLoggerTest
|
||||||
|
import com.google.common.truth.Truth.assertThat
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message.MessagePacket
|
import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message.MessagePacket
|
||||||
import org.junit.jupiter.api.Assertions
|
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.spongycastle.util.encoders.Hex
|
import org.spongycastle.util.encoders.Hex
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ import org.spongycastle.util.encoders.Hex
|
||||||
val msg = MessagePacket.parse(encryptedMessage)
|
val msg = MessagePacket.parse(encryptedMessage)
|
||||||
val decryptedMsg = enDecrypt.decrypt(msg)
|
val decryptedMsg = enDecrypt.decrypt(msg)
|
||||||
|
|
||||||
Assertions.assertEquals(decrypted.toHex(), decryptedMsg.payload.toHex())
|
assertThat(decryptedMsg.payload.toHex()).isEqualTo(decrypted.toHex())
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -56,6 +56,6 @@ import org.spongycastle.util.encoders.Hex
|
||||||
|
|
||||||
val encrypted = enDecrypt.encrypt(msg)
|
val encrypted = enDecrypt.encrypt(msg)
|
||||||
|
|
||||||
Assertions.assertEquals(encryptedMessage.toHex(), encrypted.asByteArray().toHex())
|
assertThat(encrypted.asByteArray().toHex()).isEqualTo(encryptedMessage.toHex())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue