From 38bf9d21235835999e0ca2e8a3e99f026dd5a487 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sat, 22 May 2021 20:53:41 +0530 Subject: format-common: replace deprecated functions Signed-off-by: Harsh Shandilya --- .../kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntryTest.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'format-common/src/test') diff --git a/format-common/src/test/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntryTest.kt b/format-common/src/test/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntryTest.kt index fad58be7..edf4dc10 100644 --- a/format-common/src/test/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntryTest.kt +++ b/format-common/src/test/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntryTest.kt @@ -7,6 +7,7 @@ package dev.msfjarvis.aps.data.passfile import dev.msfjarvis.aps.util.time.TestUserClock import dev.msfjarvis.aps.util.totp.TotpFinder +import java.util.Locale import kotlin.test.assertEquals import kotlin.test.assertNotNull import kotlin.test.assertNull @@ -34,7 +35,7 @@ internal class PasswordEntryTest { assertEquals("", makeEntry("").password) for (field in PasswordEntry.PASSWORD_FIELDS) { assertEquals("fooooo", makeEntry("\n$field fooooo").password) - assertEquals("fooooo", makeEntry("\n${field.toUpperCase()} fooooo").password) + assertEquals("fooooo", makeEntry("\n${field.uppercase(Locale.getDefault())} fooooo").password) assertEquals("fooooo", makeEntry("GOPASS-SECRET-1.0\n$field fooooo").password) assertEquals("fooooo", makeEntry("someFirstLine\nUsername: bar\n$field fooooo").password) } @@ -95,7 +96,10 @@ internal class PasswordEntryTest { fun testGetUsername() { for (field in PasswordEntry.USERNAME_FIELDS) { assertEquals("username", makeEntry("\n$field username").username) - assertEquals("username", makeEntry("\n${field.toUpperCase()} username").username) + assertEquals( + "username", + makeEntry("\n${field.uppercase(Locale.getDefault())} username").username + ) } assertEquals("username", makeEntry("secret\nextra\nlogin: username\ncontent\n").username) assertEquals("username", makeEntry("\nextra\nusername: username\ncontent\n").username) -- cgit v1.2.3