From 4653541a7b3a1ac308c868b7877ef4d2702451e2 Mon Sep 17 00:00:00 2001 From: Ryan Haining Date: Sun, 8 Oct 2023 16:39:34 -0700 Subject: [PATCH] Rewrites CryptTest with matchers Also renames "expect" to "expected" since "expect" is a newer kotlin keyword. Issue #2745 --- .../nightscout/pump/medtrum/encryption/CryptTest.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/encryption/CryptTest.kt b/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/encryption/CryptTest.kt index 2871bdfd14..2ef0ead2c6 100644 --- a/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/encryption/CryptTest.kt +++ b/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/encryption/CryptTest.kt @@ -1,6 +1,6 @@ package info.nightscout.pump.medtrum.encryption -import org.junit.jupiter.api.Assertions +import com.google.common.truth.Truth.assertThat import org.junit.jupiter.api.Test class CryptTest { @@ -10,9 +10,9 @@ class CryptTest { val crypt = Crypt() val input = 2859923929 - val expect = 3364239851 + val expected = 3364239851L val output: Long = crypt.keyGen(input) - Assertions.assertEquals(expect, output) + assertThat(output).isEqualTo(expected) } @Test @@ -20,8 +20,8 @@ class CryptTest { val crypt = Crypt() val input = 2859923929 - val expect: Long = 126009121 + val expected = 126009121L val output: Long = crypt.simpleDecrypt(input) - Assertions.assertEquals(expect, output) + assertThat(output).isEqualTo(expected) } }