From fa378f62495bfb521900fba5f96e5ad6471d59f9 Mon Sep 17 00:00:00 2001 From: dankito Date: Sat, 12 Feb 2022 14:21:15 +0100 Subject: [PATCH] Removed UUID --- .../net/dankito/banking/fints/FinTsTestBase.kt | 4 ++-- .../banking/fints/messages/MessageBuilderTest.kt | 6 +++--- .../net/dankito/utils/multiplatform/UUID.kt | 12 ------------ .../net/dankito/utils/multiplatform/UUID.kt | 16 ---------------- .../net/dankito/utils/multiplatform/UUID.kt | 16 ---------------- 5 files changed, 5 insertions(+), 49 deletions(-) delete mode 100644 multiplatform-utils/src/commonMain/kotlin/net/dankito/utils/multiplatform/UUID.kt delete mode 100644 multiplatform-utils/src/iosMain/kotlin/net/dankito/utils/multiplatform/UUID.kt delete mode 100644 multiplatform-utils/src/jvmMain/kotlin/net/dankito/utils/multiplatform/UUID.kt diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/FinTsTestBase.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/FinTsTestBase.kt index fdb0bd22..6df8b288 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/FinTsTestBase.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/FinTsTestBase.kt @@ -10,7 +10,7 @@ import net.dankito.banking.fints.response.segments.AccountType import net.dankito.banking.fints.response.segments.ChangeTanMediaParameters import net.dankito.banking.fints.response.segments.JobParameters import net.dankito.utils.multiplatform.Date -import net.dankito.utils.multiplatform.UUID +import kotlin.random.Random abstract class FinTsTestBase { @@ -70,7 +70,7 @@ abstract class FinTsTestBase { } protected open fun createDialogId(): String { - return UUID.random().replace("-", "") + return Random(net.dankito.utils.multiplatform.Date.nanoSecondsSinceEpoch).nextInt(1000000, 9999999).toString() } protected open fun convertDate(date: Date): String { diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/MessageBuilderTest.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/MessageBuilderTest.kt index b8413ad5..54e4caff 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/MessageBuilderTest.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/MessageBuilderTest.kt @@ -74,7 +74,7 @@ class MessageBuilderTest : FinTsTestBase() { // then expect(normalizeBinaryData(result)).toBe(normalizeBinaryData( - "HNHBK:1:3+000000000117+300+$dialogId+1'" + + "HNHBK:1:3+000000000067+300+$dialogId+1'" + "HKEND:2:1+$dialogId'" + "HNHBS:3:1+1'" )) @@ -116,9 +116,9 @@ class MessageBuilderTest : FinTsTestBase() { // then expect(normalizeBinaryData(result)).toBe(normalizeBinaryData( - "HNHBK:1:3+000000000359+300+$dialogId+1'" + + "HNHBK:1:3+000000000309+300+$dialogId+1'" + "HNVSK:998:3+PIN:2+998+1+1::0+1:$Date:$Time+2:2:13:@8@ :5:1+280:$BankCode:$CustomerId:V:0:0+0'" + - "HNVSD:999:1+@165@" + "HNSHK:2:4+PIN:2+${SecurityFunction.code}+$ControlReference+1+1+1::0+1+1:$Date:$Time+1:999:1+6:10:16+280:$BankCode:$CustomerId:S:0:0'" + + "HNVSD:999:1+@140@" + "HNSHK:2:4+PIN:2+${SecurityFunction.code}+$ControlReference+1+1+1::0+1+1:$Date:$Time+1:999:1+6:10:16+280:$BankCode:$CustomerId:S:0:0'" + "HKEND:3:1+$dialogId'" + "HNSHA:4:2+$ControlReference++$Pin''" + "HNHBS:5:1+1'" diff --git a/multiplatform-utils/src/commonMain/kotlin/net/dankito/utils/multiplatform/UUID.kt b/multiplatform-utils/src/commonMain/kotlin/net/dankito/utils/multiplatform/UUID.kt deleted file mode 100644 index 8b77b083..00000000 --- a/multiplatform-utils/src/commonMain/kotlin/net/dankito/utils/multiplatform/UUID.kt +++ /dev/null @@ -1,12 +0,0 @@ -package net.dankito.utils.multiplatform - - -expect class UUID { - - companion object { - - fun random(): String - - } - -} \ No newline at end of file diff --git a/multiplatform-utils/src/iosMain/kotlin/net/dankito/utils/multiplatform/UUID.kt b/multiplatform-utils/src/iosMain/kotlin/net/dankito/utils/multiplatform/UUID.kt deleted file mode 100644 index 0f46238e..00000000 --- a/multiplatform-utils/src/iosMain/kotlin/net/dankito/utils/multiplatform/UUID.kt +++ /dev/null @@ -1,16 +0,0 @@ -package net.dankito.utils.multiplatform - -import platform.Foundation.NSUUID - - -actual class UUID { - - actual companion object { - - actual fun random(): String { - return NSUUID().UUIDString - } - - } - -} \ No newline at end of file diff --git a/multiplatform-utils/src/jvmMain/kotlin/net/dankito/utils/multiplatform/UUID.kt b/multiplatform-utils/src/jvmMain/kotlin/net/dankito/utils/multiplatform/UUID.kt deleted file mode 100644 index 9de050ae..00000000 --- a/multiplatform-utils/src/jvmMain/kotlin/net/dankito/utils/multiplatform/UUID.kt +++ /dev/null @@ -1,16 +0,0 @@ -package net.dankito.utils.multiplatform - -import java.util.UUID - - -actual class UUID { - - actual companion object { - - actual fun random(): String { - return UUID.randomUUID().toString() - } - - } - -} \ No newline at end of file