From 56f951314a20ea8d61affbae6aebe56a71a06307 Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 13 Feb 2022 00:17:45 +0100 Subject: [PATCH] Replaced atrium asserts with Kotlin test asserts --- build.gradle | 3 - fints4k/build.gradle | 4 - .../fints/extensions/AssertExtensions.kt | 73 ++ .../fints/extensions/BooleanAssertions.kt | 9 - .../fints/messages/MessageBuilderTest.kt | 29 +- .../basisformate/TextDatenelementTest.kt | 25 +- .../basisformate/ZiffernDatenelementTest.kt | 15 +- .../implementierte/BPDVersionTest.kt | 15 +- .../implementierte/ProduktbezeichnungTest.kt | 7 +- .../DatenelementgruppeTest.kt | 11 +- .../fints/messages/segmente/SegmentTest.kt | 5 +- .../IdentifikationsSegmentTest.kt | 6 +- .../implementierte/SignaturabschlussTest.kt | 5 +- .../implementierte/SignaturkopfTest.kt | 5 +- .../VerschluesselungskopfTest.kt | 5 +- .../sepa/SepaBankTransferBaseTest.kt | 7 +- .../sepa/SepaMessageCreatorTest.kt | 21 +- ...TanGeneratorTanMediumAnOderUmmeldenTest.kt | 21 +- .../umsaetze/SaldenabfrageVersion5Test.kt | 7 +- .../umsaetze/SaldenabfrageVersion7Test.kt | 7 +- .../fints/response/ResponseParserTest.kt | 694 +++++++++--------- .../fints/tan/FlickerCodeDecoderTest.kt | 15 +- .../fints/transactions/Mt940ParserTest.kt | 117 +-- .../dankito/banking/fints/util/Base64Test.kt | 12 +- .../banking/fints/util/FinTsUtilsTest.kt | 15 +- .../banking/fints/FinTsClientTestBase.kt | 12 +- multiplatform-utils/build.gradle | 7 - tools/BankListCreator/build.gradle | 2 +- 28 files changed, 588 insertions(+), 566 deletions(-) create mode 100644 fints4k/src/commonTest/kotlin/net/dankito/banking/fints/extensions/AssertExtensions.kt delete mode 100644 fints4k/src/commonTest/kotlin/net/dankito/banking/fints/extensions/BooleanAssertions.kt diff --git a/build.gradle b/build.gradle index a9a99aee..d9a44c4f 100644 --- a/build.gradle +++ b/build.gradle @@ -11,11 +11,8 @@ ext { /* Test */ - junitVersion = '4.12' junit5Version = '5.5.2' - atriumVersion = "0.15.0" - assertJVersion = '3.12.2' mockitoVersion = '2.22.0' diff --git a/fints4k/build.gradle b/fints4k/build.gradle index c8416a91..05dcb423 100644 --- a/fints4k/build.gradle +++ b/fints4k/build.gradle @@ -56,8 +56,6 @@ kotlin { commonTest { dependencies { implementation kotlin("test") - - implementation "ch.tutteli.atrium:atrium-fluent-en_GB-common:$atriumVersion" } } @@ -76,8 +74,6 @@ kotlin { implementation "org.assertj:assertj-core:$assertJVersion" implementation "org.mockito:mockito-core:$mockitoVersion" - implementation "ch.tutteli.atrium:atrium-fluent-en_GB:$atriumVersion" - // implementation project(":BankingUiCommon") // implementation project(":BankFinder") diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/extensions/AssertExtensions.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/extensions/AssertExtensions.kt new file mode 100644 index 00000000..f0ed5177 --- /dev/null +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/extensions/AssertExtensions.kt @@ -0,0 +1,73 @@ +package net.dankito.banking.fints.extensions + +import kotlin.contracts.ExperimentalContracts +import kotlin.contracts.contract +import kotlin.test.assertEquals +import kotlin.test.assertNotNull +import kotlin.test.assertTrue +import kotlin.test.fail + + +fun assertEquals(expected: Any?, actual: Any?) { + assertEquals(expected, actual, "'$actual' should equal expected '$expected'") +} + +fun assertFalse(actual: Boolean) { + kotlin.test.assertFalse(actual, "Value should be false but isn't") +} + +fun assertTrue(actual: Boolean) { + assertTrue(actual, "Value should be true but isn't") +} + +@OptIn(ExperimentalContracts::class) +fun assertNotNull(actual: Any?) { + contract { returns() implies (actual != null) } + assertNotNull(actual, "Value should not be null but is") +} + +fun assertNull(actual: Any?) { + kotlin.test.assertNull(actual, "'$actual' is expected to be null") +} + +fun assertEmpty(string: String) { + assertTrue(string.isEmpty()) +} + +fun assertContains(string: String, vararg args: String) { + args.forEach { arg -> + kotlin.test.assertContains(string, arg) + } +} + + +fun assertSize(size: Int, collection: Collection<*>) { + assertEquals(size, collection.size, "Collection should have size $size, but has ${collection.size} elements") +} + +fun assertEmpty(collection: Collection<*>) { + assertTrue(collection.isEmpty()) +} + +fun assertContainsExactly(collection: Collection, vararg items: T) { + assertEquals(collection.size, items.size, "Size of collection is ${collection.size}, but that of expected arguments is ${items.size}") + + assertContains(collection, *items) +} + +fun assertContains(collection: Collection, vararg items: T) { + items.forEach { item -> + kotlin.test.assertContains(collection, item) + } +} + + +inline fun assertThrows(action: () -> Unit) { + try { + action() + fail("action() didn't throw any exception. Expected was ${T::class.qualifiedName}") + } catch (throwable: Throwable) { + println("Throwable is of type ${throwable::class.simpleName}: $throwable") + assertTrue(throwable is T) + } +} \ No newline at end of file diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/extensions/BooleanAssertions.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/extensions/BooleanAssertions.kt deleted file mode 100644 index 3c5bec49..00000000 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/extensions/BooleanAssertions.kt +++ /dev/null @@ -1,9 +0,0 @@ -package net.dankito.banking.fints.extensions - -import ch.tutteli.atrium.creating.Expect -import ch.tutteli.atrium.domain.builders.ExpectImpl - - -fun Expect.isTrue(): Expect = addAssertion(ExpectImpl.any.toBe(this, true)) - -fun Expect.isFalse(): Expect = addAssertion(ExpectImpl.any.toBe(this, false)) \ No newline at end of file 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 cd37ce40..7043ebb6 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 @@ -1,8 +1,5 @@ package net.dankito.banking.fints.messages -import ch.tutteli.atrium.api.fluent.en_GB.notToBeNull -import ch.tutteli.atrium.api.fluent.en_GB.toBe -import ch.tutteli.atrium.api.verbs.expect import kotlinx.datetime.LocalDate import kotlinx.datetime.LocalDateTime import kotlinx.datetime.Month @@ -15,9 +12,7 @@ import net.dankito.banking.fints.response.segments.JobParameters import net.dankito.banking.fints.response.segments.PinInfo import net.dankito.banking.fints.response.segments.RetrieveAccountTransactionsParameters import net.dankito.banking.fints.util.FinTsUtils -import kotlin.test.AfterTest -import kotlin.test.Ignore -import kotlin.test.Test +import kotlin.test.* class MessageBuilderTest : FinTsTestBase() { @@ -55,7 +50,7 @@ class MessageBuilderTest : FinTsTestBase() { val result = underTest.createAnonymousDialogInitMessage(context).createdMessage // then - expect(result).toBe( + assertEquals(result, "HNHBK:1:3+000000000125+300+0+1'" + "HKIDN:2:2+280:12345678+${CustomerId}+0+0'" + "HKVVB:3:3+0+0+${Language.code}+$ProductName+$ProductVersion'" + @@ -74,7 +69,7 @@ class MessageBuilderTest : FinTsTestBase() { val result = underTest.createAnonymousDialogEndMessage(context).createdMessage ?: "" // then - expect(normalizeBinaryData(result)).toBe(normalizeBinaryData( + assertEquals(normalizeBinaryData(result), normalizeBinaryData( "HNHBK:1:3+000000000067+300+$dialogId+1'" + "HKEND:2:1+$dialogId'" + "HNHBS:3:1+1'" @@ -92,7 +87,7 @@ class MessageBuilderTest : FinTsTestBase() { val result = underTest.createSynchronizeCustomerSystemIdMessage(context).createdMessage ?: "" // then - expect(normalizeBinaryData(result)).toBe(normalizeBinaryData( + assertEquals(normalizeBinaryData(result), normalizeBinaryData( "HNHBK:1:3+000000000397+300+0+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+@234@" + "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'" + @@ -116,7 +111,7 @@ class MessageBuilderTest : FinTsTestBase() { val result = underTest.createDialogEndMessage(context).createdMessage ?: "" // then - expect(normalizeBinaryData(result)).toBe(normalizeBinaryData( + assertEquals(normalizeBinaryData(result), normalizeBinaryData( "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+@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'" + @@ -137,7 +132,7 @@ class MessageBuilderTest : FinTsTestBase() { val result = underTest.createGetTransactionsMessage(context, GetAccountTransactionsParameter(Bank, Account)) // then - expect(result.isJobAllowed).toBe(false) + assertFalse(result.isJobAllowed) } @Test @@ -156,8 +151,8 @@ class MessageBuilderTest : FinTsTestBase() { val result = underTest.createGetTransactionsMessage(context, GetAccountTransactionsParameter(Bank, account)) // then - expect(result.isJobAllowed).toBe(true) - expect(result.isJobVersionSupported).toBe(false) + assertTrue(result.isJobAllowed) + assertFalse(result.isJobVersionSupported) } @Test @@ -180,9 +175,9 @@ class MessageBuilderTest : FinTsTestBase() { val result = underTest.createGetTransactionsMessage(context, GetAccountTransactionsParameter(Bank, account, false, fromDate, toDate, maxCountEntries)) // then - expect(result.createdMessage).notToBeNull() + assertNotNull(result.createdMessage) - expect(normalizeBinaryData(result.createdMessage!!)).toBe(normalizeBinaryData( + assertEquals(normalizeBinaryData(result.createdMessage!!), normalizeBinaryData( "HNHBK:1:3+000000000361+300+0+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+@198@" + "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'" + @@ -216,9 +211,9 @@ class MessageBuilderTest : FinTsTestBase() { GetAccountTransactionsParameter(Bank, account, false, fromDate, toDate, maxCountEntries, false)) // then - expect(result.createdMessage).notToBeNull() + assertNotNull(result.createdMessage) - expect(normalizeBinaryData(result.createdMessage!!)).toBe(normalizeBinaryData( + assertEquals(normalizeBinaryData(result.createdMessage!!), normalizeBinaryData( "HNHBK:1:3+000000000340+300+0+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+@225@" + "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'" + diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/datenelemente/basisformate/TextDatenelementTest.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/datenelemente/basisformate/TextDatenelementTest.kt index 1d20512c..ead503ae 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/datenelemente/basisformate/TextDatenelementTest.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/datenelemente/basisformate/TextDatenelementTest.kt @@ -1,11 +1,10 @@ package net.dankito.banking.fints.messages.datenelemente.basisformate -import ch.tutteli.atrium.api.fluent.en_GB.toBe -import ch.tutteli.atrium.api.fluent.en_GB.toThrow -import ch.tutteli.atrium.api.verbs.expect +import net.dankito.banking.fints.extensions.assertThrows import net.dankito.banking.fints.messages.Existenzstatus import net.dankito.banking.fints.messages.datenelementgruppen.implementierte.signatur.SicherheitsidentifikationDetails import kotlin.test.Test +import kotlin.test.assertEquals class TextDatenelementTest { @@ -30,9 +29,9 @@ class TextDatenelementTest { val underTest = createTextDatenelement("α") // when - expect { + assertThrows { underTest.validate() - }.toThrow() + } } @Test @@ -42,9 +41,9 @@ class TextDatenelementTest { val underTest = createTextDatenelement("Я") // when - expect { + assertThrows { underTest.validate() - }.toThrow() + } } @Test @@ -54,9 +53,9 @@ class TextDatenelementTest { val underTest = createTextDatenelement("€") // is only allowed by ISO-8859-15, not by ISO-8859-1 // when - expect { + assertThrows { underTest.validate() - }.toThrow() + } } @@ -75,7 +74,7 @@ class TextDatenelementTest { // then - expect(result).toBe(expected) + assertEquals(expected, result) } @Test @@ -93,7 +92,7 @@ class TextDatenelementTest { // then - expect(result).toBe(expected) + assertEquals(expected, result) } @Test @@ -111,7 +110,7 @@ class TextDatenelementTest { // then - expect(result).toBe(expected) + assertEquals(expected, result) } @Test @@ -130,7 +129,7 @@ class TextDatenelementTest { // then - expect(result).toBe(expected) + assertEquals(expected, result) } diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/datenelemente/basisformate/ZiffernDatenelementTest.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/datenelemente/basisformate/ZiffernDatenelementTest.kt index 1eda7d14..836d6335 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/datenelemente/basisformate/ZiffernDatenelementTest.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/datenelemente/basisformate/ZiffernDatenelementTest.kt @@ -1,10 +1,9 @@ package net.dankito.banking.fints.messages.datenelemente.basisformate -import ch.tutteli.atrium.api.fluent.en_GB.toBe -import ch.tutteli.atrium.api.fluent.en_GB.toThrow -import ch.tutteli.atrium.api.verbs.expect +import net.dankito.banking.fints.extensions.assertThrows import net.dankito.banking.fints.messages.Existenzstatus import kotlin.test.Test +import kotlin.test.assertEquals class ZiffernDatenelementTest { @@ -19,7 +18,7 @@ class ZiffernDatenelementTest { val result = underTest.format() // then - expect(result).toBe("000001") + assertEquals("000001", result) } @@ -56,9 +55,9 @@ class ZiffernDatenelementTest { val underTest = createZiffernDatenelement(-1, 3) // when - expect { + assertThrows { underTest.validate() - }.toThrow() + } } @Test @@ -68,9 +67,9 @@ class ZiffernDatenelementTest { val underTest = createZiffernDatenelement(1000, 3) // when - expect { + assertThrows { underTest.validate() - }.toThrow() + } } diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/datenelemente/implementierte/BPDVersionTest.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/datenelemente/implementierte/BPDVersionTest.kt index 3a233e50..021ff84f 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/datenelemente/implementierte/BPDVersionTest.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/datenelemente/implementierte/BPDVersionTest.kt @@ -1,10 +1,9 @@ package net.dankito.banking.fints.messages.datenelemente.implementierte -import ch.tutteli.atrium.api.fluent.en_GB.toBe -import ch.tutteli.atrium.api.fluent.en_GB.toThrow -import ch.tutteli.atrium.api.verbs.expect +import net.dankito.banking.fints.extensions.assertThrows import net.dankito.banking.fints.messages.Existenzstatus import kotlin.test.Test +import kotlin.test.assertEquals class BPDVersionTest { @@ -19,7 +18,7 @@ class BPDVersionTest { val result = underTest.format() // then - expect(result).toBe("3") + assertEquals("3", result) } @@ -56,9 +55,9 @@ class BPDVersionTest { val underTest = BPDVersion(-1, Existenzstatus.Mandatory) // when - expect { + assertThrows { underTest.validate() - }.toThrow() + } } @Test @@ -68,9 +67,9 @@ class BPDVersionTest { val underTest = BPDVersion(1000, Existenzstatus.Mandatory) // when - expect { + assertThrows { underTest.validate() - }.toThrow() + } } } \ No newline at end of file diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/datenelemente/implementierte/ProduktbezeichnungTest.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/datenelemente/implementierte/ProduktbezeichnungTest.kt index 41b3720c..d27c8ec2 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/datenelemente/implementierte/ProduktbezeichnungTest.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/datenelemente/implementierte/ProduktbezeichnungTest.kt @@ -1,7 +1,6 @@ package net.dankito.banking.fints.messages.datenelemente.implementierte -import ch.tutteli.atrium.api.fluent.en_GB.toThrow -import ch.tutteli.atrium.api.verbs.expect +import net.dankito.banking.fints.extensions.assertThrows import net.dankito.banking.fints.messages.Existenzstatus import kotlin.test.Test @@ -28,9 +27,9 @@ class ProduktbezeichnungTest { val underTest = Produktbezeichnung("12345678901234567890123456", Existenzstatus.Mandatory) // when - expect { + assertThrows { underTest.validate() - }.toThrow() + } } } \ No newline at end of file diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/datenelementgruppen/DatenelementgruppeTest.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/datenelementgruppen/DatenelementgruppeTest.kt index e08a496d..8b03a124 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/datenelementgruppen/DatenelementgruppeTest.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/datenelementgruppen/DatenelementgruppeTest.kt @@ -1,11 +1,10 @@ package net.dankito.banking.fints.messages.datenelementgruppen -import ch.tutteli.atrium.api.fluent.en_GB.isEmpty -import ch.tutteli.atrium.api.fluent.en_GB.toBe -import ch.tutteli.atrium.api.verbs.expect +import net.dankito.banking.fints.extensions.assertEmpty import net.dankito.banking.fints.messages.Separators import net.dankito.banking.fints.messages.datenelementgruppen.implementierte.signatur.BenutzerdefinierteSignatur import kotlin.test.Test +import kotlin.test.assertEquals class DatenelementgruppeTest { @@ -22,7 +21,7 @@ class DatenelementgruppeTest { val result = dataElementGroup.format() // then - expect(result).toBe(pin + Separators.DataElementsSeparator + tan) // ":" does not get written to output + assertEquals(pin + Separators.DataElementsSeparator + tan, result) // ":" does not get written to output } @Test @@ -37,7 +36,7 @@ class DatenelementgruppeTest { val result = dataElementGroup.format() // then - expect(result).toBe(pin) // ":" does not get written to output + assertEquals(pin, result) // ":" does not get written to output } @Test @@ -52,7 +51,7 @@ class DatenelementgruppeTest { val result = dataElementGroup.format() // then - expect(result).isEmpty() // ":" does not get written to output + assertEmpty(result) // ":" does not get written to output } } \ No newline at end of file diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/SegmentTest.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/SegmentTest.kt index 5ded8e8b..f0409709 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/SegmentTest.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/SegmentTest.kt @@ -1,11 +1,10 @@ package net.dankito.banking.fints.messages.segmente -import ch.tutteli.atrium.api.fluent.en_GB.toBe import net.dankito.banking.fints.messages.Existenzstatus import net.dankito.banking.fints.messages.datenelemente.DatenelementBase import net.dankito.banking.fints.messages.datenelemente.basisformate.TextDatenelement -import ch.tutteli.atrium.api.verbs.expect import kotlin.test.Test +import kotlin.test.assertEquals class SegmentTest { @@ -32,7 +31,7 @@ class SegmentTest { // then // assert that empty data elements at end get cut but that the empty ones in the middle remain - expect(result).toBe("DE1+DE2++++DE6++DE8") + assertEquals("DE1+DE2++++DE6++DE8", result) } diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/IdentifikationsSegmentTest.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/IdentifikationsSegmentTest.kt index bcdc2d03..abb15482 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/IdentifikationsSegmentTest.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/IdentifikationsSegmentTest.kt @@ -1,10 +1,8 @@ package net.dankito.banking.fints.messages.segmente.implementierte -import ch.tutteli.atrium.api.fluent.en_GB.toBe import net.dankito.banking.fints.FinTsTestBase -import net.dankito.banking.fints.model.MessageBaseData -import ch.tutteli.atrium.api.verbs.expect import kotlin.test.Test +import kotlin.test.assertEquals class IdentifikationsSegmentTest : FinTsTestBase() { @@ -19,7 +17,7 @@ class IdentifikationsSegmentTest : FinTsTestBase() { val result = underTest.format() // then - expect(result).toBe("HKIDN:2:2+280:12345678+0987654321+0+0") + assertEquals(result, "HKIDN:2:2+280:12345678+0987654321+0+0") } } \ No newline at end of file diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/SignaturabschlussTest.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/SignaturabschlussTest.kt index 21c78aa8..5b283c9d 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/SignaturabschlussTest.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/SignaturabschlussTest.kt @@ -1,8 +1,7 @@ package net.dankito.banking.fints.messages.segmente.implementierte -import ch.tutteli.atrium.api.fluent.en_GB.toBe -import ch.tutteli.atrium.api.verbs.expect import kotlin.test.Test +import kotlin.test.assertEquals class SignaturabschlussTest { @@ -20,7 +19,7 @@ class SignaturabschlussTest { val result = underTest.format() // then - expect(result).toBe("HNSHA:$segmentNumber:2+$controlReference++$pin") + assertEquals(result, "HNSHA:$segmentNumber:2+$controlReference++$pin") } } \ No newline at end of file diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/SignaturkopfTest.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/SignaturkopfTest.kt index f22a2e21..ec384c68 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/SignaturkopfTest.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/SignaturkopfTest.kt @@ -1,10 +1,9 @@ package net.dankito.banking.fints.messages.segmente.implementierte -import ch.tutteli.atrium.api.fluent.en_GB.toBe import net.dankito.banking.fints.FinTsTestBase import net.dankito.banking.fints.model.MessageBaseData -import ch.tutteli.atrium.api.verbs.expect import kotlin.test.Test +import kotlin.test.assertEquals class SignaturkopfTest : FinTsTestBase() { @@ -22,7 +21,7 @@ class SignaturkopfTest : FinTsTestBase() { val result = underTest.format() // then - expect(result).toBe("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") + assertEquals(result, "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") } } \ No newline at end of file diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/VerschluesselungskopfTest.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/VerschluesselungskopfTest.kt index a49f0dc0..67bea682 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/VerschluesselungskopfTest.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/VerschluesselungskopfTest.kt @@ -1,10 +1,9 @@ package net.dankito.banking.fints.messages.segmente.implementierte -import ch.tutteli.atrium.api.fluent.en_GB.toBe import net.dankito.banking.fints.FinTsTestBase import net.dankito.banking.fints.model.MessageBaseData -import ch.tutteli.atrium.api.verbs.expect import kotlin.test.Test +import kotlin.test.assertEquals class VerschluesselungskopfTest : FinTsTestBase() { @@ -20,7 +19,7 @@ class VerschluesselungskopfTest : FinTsTestBase() { val result = underTest.format() // then - expect(normalizeBinaryData(result)).toBe("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") + assertEquals(normalizeBinaryData(result), "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") } } \ No newline at end of file diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/sepa/SepaBankTransferBaseTest.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/sepa/SepaBankTransferBaseTest.kt index 1ffb2bcd..012e030b 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/sepa/SepaBankTransferBaseTest.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/sepa/SepaBankTransferBaseTest.kt @@ -1,7 +1,6 @@ package net.dankito.banking.fints.messages.segmente.implementierte.sepa -import ch.tutteli.atrium.api.fluent.en_GB.contains -import ch.tutteli.atrium.api.verbs.expect +import net.dankito.banking.fints.extensions.assertContains import net.dankito.banking.fints.messages.segmente.id.CustomerSegmentId import net.dankito.banking.fints.model.* import kotlin.test.Test @@ -42,7 +41,7 @@ class SepaBankTransferBaseTest { // then - expect(result).contains(debitorName, debitorIban, debitorBic, recipientName, recipientIban, recipientBic, + assertContains(result, debitorName, debitorIban, debitorBic, recipientName, recipientIban, recipientBic, amount.toString().replace(',', '.'), reference, "urn?:iso?:std?:iso?:20022?:tech?:xsd?:pain.001.001.03") } @@ -64,7 +63,7 @@ class SepaBankTransferBaseTest { // then - expect(result).contains(debitorName, debitorIban, debitorBic, recipientName, recipientIban, recipientBic, + assertContains(result, debitorName, debitorIban, debitorBic, recipientName, recipientIban, recipientBic, amount.toString().replace(',', '.'), reference, "urn?:iso?:std?:iso?:20022?:tech?:xsd?:pain.001.003.03") } diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/sepa/SepaMessageCreatorTest.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/sepa/SepaMessageCreatorTest.kt index ed353271..de92004e 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/sepa/SepaMessageCreatorTest.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/sepa/SepaMessageCreatorTest.kt @@ -1,9 +1,8 @@ package net.dankito.banking.fints.messages.segmente.implementierte.sepa -import ch.tutteli.atrium.api.verbs.expect -import net.dankito.banking.fints.extensions.isFalse -import net.dankito.banking.fints.extensions.isTrue import kotlin.test.Test +import kotlin.test.assertFalse +import kotlin.test.assertTrue class SepaMessageCreatorTest { @@ -18,7 +17,7 @@ class SepaMessageCreatorTest { val result = underTest.containsOnlyAllowedCharacters("Marieke Musterfrau") // then - expect(result).isTrue() + assertTrue(result) } @Test @@ -28,7 +27,7 @@ class SepaMessageCreatorTest { val result = underTest.containsOnlyAllowedCharacters("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789,.?+-/()") // then - expect(result).isTrue() + assertTrue(result) } @Test @@ -38,7 +37,7 @@ class SepaMessageCreatorTest { val result = underTest.containsOnlyAllowedCharacters(":") // then - expect(result).isTrue() + assertTrue(result) } @Test @@ -48,7 +47,7 @@ class SepaMessageCreatorTest { val result = underTest.containsOnlyAllowedCharacters("!") // then - expect(result).isFalse() + assertFalse(result) } @Test @@ -58,17 +57,17 @@ class SepaMessageCreatorTest { val result = underTest.containsOnlyAllowedCharacters("€") // then - expect(result).isFalse() + assertFalse(result) } @Test - fun `containsOnlyAllowedCharacters @ is an illegal character`() { + fun `containsOnlyAllowedCharacters at sign is an illegal character`() { // when val result = underTest.containsOnlyAllowedCharacters("@") // then - expect(result).isFalse() + assertFalse(result) } @Test @@ -78,7 +77,7 @@ class SepaMessageCreatorTest { val result = underTest.containsOnlyAllowedCharacters("ö") // then - expect(result).isFalse() + assertFalse(result) } } \ No newline at end of file diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/tan/TanGeneratorTanMediumAnOderUmmeldenTest.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/tan/TanGeneratorTanMediumAnOderUmmeldenTest.kt index 1fe74a86..426759db 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/tan/TanGeneratorTanMediumAnOderUmmeldenTest.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/tan/TanGeneratorTanMediumAnOderUmmeldenTest.kt @@ -1,13 +1,12 @@ package net.dankito.banking.fints.messages.segmente.implementierte.tan -import ch.tutteli.atrium.api.fluent.en_GB.toBe -import ch.tutteli.atrium.api.verbs.expect import net.dankito.banking.fints.FinTsTestBase import net.dankito.banking.fints.messages.datenelemente.implementierte.tan.TanGeneratorTanMedium import net.dankito.banking.fints.messages.datenelemente.implementierte.tan.TanMediumKlasse import net.dankito.banking.fints.messages.datenelemente.implementierte.tan.TanMediumStatus import net.dankito.banking.fints.response.segments.ChangeTanMediaParameters import kotlin.test.Test +import kotlin.test.assertEquals class TanGeneratorTanMediumAnOderUmmeldenTest: FinTsTestBase() { @@ -50,7 +49,7 @@ class TanGeneratorTanMediumAnOderUmmeldenTest: FinTsTestBase() { // then - expect(result).toBe("HKTAU:$SegmentNumber:1+G+$CardNumber") + assertEquals(result, "HKTAU:$SegmentNumber:1+G+$CardNumber") } @Test @@ -67,7 +66,7 @@ class TanGeneratorTanMediumAnOderUmmeldenTest: FinTsTestBase() { // then - expect(result).toBe("HKTAU:$SegmentNumber:1+G+$CardNumber+++$ATC+$TAN") + assertEquals(result, "HKTAU:$SegmentNumber:1+G+$CardNumber+++$ATC+$TAN") } @Test @@ -84,7 +83,7 @@ class TanGeneratorTanMediumAnOderUmmeldenTest: FinTsTestBase() { // then - expect(result).toBe("HKTAU:$SegmentNumber:1+G+$CardNumber+$CardSequenceNumber") + assertEquals(result, "HKTAU:$SegmentNumber:1+G+$CardNumber+$CardSequenceNumber") } @Test @@ -101,7 +100,7 @@ class TanGeneratorTanMediumAnOderUmmeldenTest: FinTsTestBase() { // then - expect(result).toBe("HKTAU:$SegmentNumber:1+G+$CardNumber+$CardSequenceNumber++$ATC+$TAN") + assertEquals(result, "HKTAU:$SegmentNumber:1+G+$CardNumber+$CardSequenceNumber++$ATC+$TAN") } @@ -119,7 +118,7 @@ class TanGeneratorTanMediumAnOderUmmeldenTest: FinTsTestBase() { // then - expect(result).toBe("HKTAU:$SegmentNumber:2+G+$CardNumber+++$CustomerId::$BankCountryCode:$BankCode") + assertEquals(result, "HKTAU:$SegmentNumber:2+G+$CardNumber+++$CustomerId::$BankCountryCode:$BankCode") } @Test @@ -136,7 +135,7 @@ class TanGeneratorTanMediumAnOderUmmeldenTest: FinTsTestBase() { // then - expect(result).toBe("HKTAU:$SegmentNumber:2+G+$CardNumber+++$CustomerId::$BankCountryCode:$BankCode++++$ATC+$TAN") + assertEquals(result, "HKTAU:$SegmentNumber:2+G+$CardNumber+++$CustomerId::$BankCountryCode:$BankCode++++$ATC+$TAN") } @Test @@ -153,7 +152,7 @@ class TanGeneratorTanMediumAnOderUmmeldenTest: FinTsTestBase() { // then - expect(result).toBe("HKTAU:$SegmentNumber:2+G+$CardNumber+$CardSequenceNumber++$CustomerId::$BankCountryCode:$BankCode") + assertEquals(result, "HKTAU:$SegmentNumber:2+G+$CardNumber+$CardSequenceNumber++$CustomerId::$BankCountryCode:$BankCode") } @Test @@ -170,7 +169,7 @@ class TanGeneratorTanMediumAnOderUmmeldenTest: FinTsTestBase() { // then - expect(result).toBe("HKTAU:$SegmentNumber:2+G+$CardNumber++$CardType+$CustomerId::$BankCountryCode:$BankCode") + assertEquals(result, "HKTAU:$SegmentNumber:2+G+$CardNumber++$CardType+$CustomerId::$BankCountryCode:$BankCode") } @Test @@ -187,7 +186,7 @@ class TanGeneratorTanMediumAnOderUmmeldenTest: FinTsTestBase() { // then - expect(result).toBe("HKTAU:$SegmentNumber:2+G+$CardNumber+$CardSequenceNumber+$CardType+$CustomerId::$BankCountryCode:$BankCode++++$ATC+$TAN") + assertEquals(result, "HKTAU:$SegmentNumber:2+G+$CardNumber+$CardSequenceNumber+$CardType+$CustomerId::$BankCountryCode:$BankCode++++$ATC+$TAN") } // TODO: may also test 'gueltig ab' and 'gueltig bis' diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/umsaetze/SaldenabfrageVersion5Test.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/umsaetze/SaldenabfrageVersion5Test.kt index a7e951a5..4a9ca103 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/umsaetze/SaldenabfrageVersion5Test.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/umsaetze/SaldenabfrageVersion5Test.kt @@ -1,9 +1,8 @@ package net.dankito.banking.fints.messages.segmente.implementierte.umsaetze -import ch.tutteli.atrium.api.fluent.en_GB.toBe -import ch.tutteli.atrium.api.verbs.expect import net.dankito.banking.fints.FinTsTestBase import kotlin.test.Test +import kotlin.test.assertEquals class SaldenabfrageVersion5Test : FinTsTestBase() { @@ -18,7 +17,7 @@ class SaldenabfrageVersion5Test : FinTsTestBase() { val result = underTest.format() // then - expect(result).toBe("HKSAL:3:5+$CustomerId::280:$BankCode+N") + assertEquals(result, "HKSAL:3:5+$CustomerId::280:$BankCode+N") } @Test @@ -31,7 +30,7 @@ class SaldenabfrageVersion5Test : FinTsTestBase() { val result = underTest.format() // then - expect(result).toBe("HKSAL:3:5+$CustomerId::280:$BankCode+J") + assertEquals(result, "HKSAL:3:5+$CustomerId::280:$BankCode+J") } } \ No newline at end of file diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/umsaetze/SaldenabfrageVersion7Test.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/umsaetze/SaldenabfrageVersion7Test.kt index 67127a00..35b072ec 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/umsaetze/SaldenabfrageVersion7Test.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/messages/segmente/implementierte/umsaetze/SaldenabfrageVersion7Test.kt @@ -1,9 +1,8 @@ package net.dankito.banking.fints.messages.segmente.implementierte.umsaetze -import ch.tutteli.atrium.api.fluent.en_GB.toBe import net.dankito.banking.fints.FinTsTestBase -import ch.tutteli.atrium.api.verbs.expect import kotlin.test.Test +import kotlin.test.assertEquals class SaldenabfrageVersion7Test : FinTsTestBase() { @@ -18,7 +17,7 @@ class SaldenabfrageVersion7Test : FinTsTestBase() { val result = underTest.format() // then - expect(result).toBe("HKSAL:3:7+$Iban:$Bic:$CustomerId::280:$BankCode+N") + assertEquals(result, "HKSAL:3:7+$Iban:$Bic:$CustomerId::280:$BankCode+N") } @Test @@ -31,7 +30,7 @@ class SaldenabfrageVersion7Test : FinTsTestBase() { val result = underTest.format() // then - expect(result).toBe("HKSAL:3:7+$Iban:$Bic:$CustomerId::280:$BankCode+J") + assertEquals(result, "HKSAL:3:7+$Iban:$Bic:$CustomerId::280:$BankCode+J") } } \ No newline at end of file diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/response/ResponseParserTest.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/response/ResponseParserTest.kt index 7fa9919b..a702edd5 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/response/ResponseParserTest.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/response/ResponseParserTest.kt @@ -1,6 +1,5 @@ package net.dankito.banking.fints.response -import ch.tutteli.atrium.api.fluent.en_GB.* import net.dankito.banking.fints.FinTsTestBase import net.dankito.banking.fints.messages.datenelemente.implementierte.Dialogsprache import net.dankito.banking.fints.messages.datenelemente.implementierte.HbciVersion @@ -12,14 +11,13 @@ import net.dankito.banking.fints.messages.datenelementgruppen.implementierte.sig import net.dankito.banking.fints.messages.segmente.id.ISegmentId import net.dankito.banking.fints.messages.segmente.id.MessageSegmentId import net.dankito.banking.fints.response.segments.* -import ch.tutteli.atrium.api.verbs.expect import kotlinx.datetime.LocalDate -import net.dankito.banking.fints.extensions.isFalse -import net.dankito.banking.fints.extensions.isTrue +import net.dankito.banking.fints.extensions.assertContains +import net.dankito.banking.fints.extensions.assertContainsExactly +import net.dankito.banking.fints.extensions.assertEmpty +import net.dankito.banking.fints.extensions.assertSize import net.dankito.banking.fints.model.Amount -import kotlin.test.Ignore -import kotlin.test.Test -import kotlin.test.fail +import kotlin.test.* class ResponseParserTest : FinTsTestBase() { @@ -37,9 +35,9 @@ class ResponseParserTest : FinTsTestBase() { ) // then - expect(result.receivedSegments).hasSize(2) + assertSize(2, result.receivedSegments) - expect(result.messageHeader?.dialogId).toBe("abcd'efg") + assertEquals("abcd'efg", result.messageHeader?.dialogId) } @Test @@ -52,9 +50,9 @@ class ResponseParserTest : FinTsTestBase() { ) // then - expect(result.receivedSegments).hasSize(2) + assertSize(2, result.receivedSegments) - expect(result.messageHeader?.dialogId).toBe("abcd+efg") + assertEquals("abcd+efg", result.messageHeader?.dialogId) } @Test @@ -67,9 +65,9 @@ class ResponseParserTest : FinTsTestBase() { ) // then - expect(result.receivedSegments).hasSize(2) + assertSize(2, result.receivedSegments) - expect(result.messageHeader?.dialogId).toBe("https://www.example.org") + assertEquals("https://www.example.org", result.messageHeader?.dialogId) } @Test @@ -82,9 +80,9 @@ class ResponseParserTest : FinTsTestBase() { ) // then - expect(result.receivedSegments).hasSize(2) + assertSize(2, result.receivedSegments) - expect(result.messageHeader?.dialogId).toBe("abcd?efg") + assertEquals("abcd?efg", result.messageHeader?.dialogId) } @@ -98,13 +96,13 @@ class ResponseParserTest : FinTsTestBase() { "HNHBS:3:1+1'") // then - expect(result.receivedSegments).hasSize(5) + assertSize(5, result.receivedSegments) assertCouldParseSegment(result, InstituteSegmentId.MessageFeedback, 2, 2) - expect(result.messageFeedback).notToBeNull() - expect(result.messageFeedback?.isError ?: false).isTrue() - expect(result.messageFeedback?.feedbacks?.map { it.message } ?: listOf()).containsExactly("Nachricht nicht erwartet.", "Dialoginitialisierung abgebrochen.") + assertNotNull(result.messageFeedback) + assertTrue(result.messageFeedback?.isError ?: false) + assertContainsExactly(result.messageFeedback?.feedbacks?.map { it.message } ?: listOf(), "Nachricht nicht erwartet.", "Dialoginitialisierung abgebrochen.") } @@ -117,13 +115,13 @@ class ResponseParserTest : FinTsTestBase() { // then assertSuccessfullyParsedSegment(result, MessageSegmentId.MessageHeader, 1, 3) - expect(result.messageHeader).notToBeNull() + assertNotNull(result.messageHeader) val header = result.receivedSegments.first() as ReceivedMessageHeader - expect(header.messageSize).toBe(596) - expect(header.finTsVersion).toBe(300) - expect(header.dialogId).toBe("817407729605=887211382312BLB4=") - expect(header.messageNumber).toBe(2) + assertEquals(596, header.messageSize) + assertEquals(300, header.finTsVersion) + assertEquals("817407729605=887211382312BLB4=", header.dialogId) + assertEquals(2, header.messageNumber) } @@ -136,17 +134,17 @@ class ResponseParserTest : FinTsTestBase() { // then assertSuccessfullyParsedSegment(result, InstituteSegmentId.MessageFeedback, 3, 2) - expect(result.messageFeedback).notToBeNull() + assertNotNull(result.messageFeedback) - expect(result.messageFeedback?.feedbacks ?: listOf()).hasSize(1) + assertCountFeedbacks(result, 1) val firstFeedback = result.messageFeedback?.feedbacks?.get(0)!! - expect(firstFeedback.responseCode).toBe(3060) - expect(firstFeedback.isSuccess).isFalse() - expect(firstFeedback.isWarning).isTrue() - expect(firstFeedback.isError).isFalse() - expect(firstFeedback.message).toBe("Bitte beachten Sie die enthaltenen Warnungen/Hinweise.") - expect(firstFeedback.parameter).toBe(null) + assertEquals(3060, firstFeedback.responseCode) + assertFalse(firstFeedback.isSuccess) + assertTrue(firstFeedback.isWarning) + assertFalse(firstFeedback.isError) + assertEquals("Bitte beachten Sie die enthaltenen Warnungen/Hinweise.", firstFeedback.message) + assertEquals(null, firstFeedback.parameter) } @Test @@ -158,17 +156,17 @@ class ResponseParserTest : FinTsTestBase() { // then assertCouldParseSegment(result, InstituteSegmentId.MessageFeedback, 3, 2) - expect(result.messageFeedback).notToBeNull() + assertNotNull(result.messageFeedback) - expect(result.messageFeedback?.feedbacks ?: listOf()).hasSize(1) + assertCountFeedbacks(result, 1) val firstFeedback = result.messageFeedback?.feedbacks?.get(0)!! - expect(firstFeedback.responseCode).toBe(9050) - expect(firstFeedback.isSuccess).isFalse() - expect(firstFeedback.isWarning).isFalse() - expect(firstFeedback.isError).isTrue() - expect(firstFeedback.message).toBe("Die Nachricht enthält Fehler.") - expect(firstFeedback.parameter).toBe(null) + assertEquals(9050, firstFeedback.responseCode) + assertFalse(firstFeedback.isSuccess) + assertFalse(firstFeedback.isWarning) + assertTrue(firstFeedback.isError) + assertEquals("Die Nachricht enthält Fehler.", firstFeedback.message) + assertEquals(null, firstFeedback.parameter) } @Test @@ -180,25 +178,25 @@ class ResponseParserTest : FinTsTestBase() { // then assertCouldParseSegment(result, InstituteSegmentId.MessageFeedback, 3, 2) - expect(result.messageFeedback).notToBeNull() + assertNotNull(result.messageFeedback) - expect(result.messageFeedback?.feedbacks ?: listOf()).hasSize(2) + assertCountFeedbacks(result, 2) val firstFeedback = result.messageFeedback?.feedbacks?.get(0)!! - expect(firstFeedback.responseCode).toBe(9050) - expect(firstFeedback.isSuccess).isFalse() - expect(firstFeedback.isWarning).isFalse() - expect(firstFeedback.isError).isTrue() - expect(firstFeedback.message).toBe("Die Nachricht enthält Fehler.") - expect(firstFeedback.parameter).toBe(null) + assertEquals(9050, firstFeedback.responseCode) + assertFalse(firstFeedback.isSuccess) + assertFalse(firstFeedback.isWarning) + assertTrue(firstFeedback.isError) + assertEquals("Die Nachricht enthält Fehler.", firstFeedback.message) + assertEquals(null, firstFeedback.parameter) val secondFeedback = result.messageFeedback?.feedbacks?.get(1)!! - expect(secondFeedback.responseCode).toBe(3905) - expect(secondFeedback.isSuccess).isFalse() - expect(secondFeedback.isWarning).isTrue() - expect(secondFeedback.isError).isFalse() - expect(secondFeedback.message).toBe("Es wurde keine Challenge erzeugt.") - expect(secondFeedback.parameter).toBe(null) + assertEquals(3905, secondFeedback.responseCode) + assertFalse(secondFeedback.isSuccess) + assertTrue(secondFeedback.isWarning) + assertFalse(secondFeedback.isError) + assertEquals("Es wurde keine Challenge erzeugt.", secondFeedback.message) + assertEquals(null, secondFeedback.parameter) } @Test @@ -210,25 +208,25 @@ class ResponseParserTest : FinTsTestBase() { // then assertCouldParseSegment(result, InstituteSegmentId.MessageFeedback, 3, 2) - expect(result.messageFeedback).notToBeNull() + assertNotNull(result.messageFeedback) - expect(result.messageFeedback?.feedbacks ?: listOf()).hasSize(2) + assertCountFeedbacks(result, 2) val firstFeedback = result.messageFeedback?.feedbacks?.get(0)!! - expect(firstFeedback.responseCode).toBe(9050) - expect(firstFeedback.isSuccess).isFalse() - expect(firstFeedback.isWarning).isFalse() - expect(firstFeedback.isError).isTrue() - expect(firstFeedback.message).toBe("Die Nachricht enthält Fehler.") - expect(firstFeedback.parameter).toBe(null) + assertEquals(9050, firstFeedback.responseCode) + assertFalse(firstFeedback.isSuccess) + assertFalse(firstFeedback.isWarning) + assertTrue(firstFeedback.isError) + assertEquals("Die Nachricht enthält Fehler.", firstFeedback.message) + assertEquals(null, firstFeedback.parameter) val secondFeedback = result.messageFeedback?.feedbacks?.get(1)!! - expect(secondFeedback.responseCode).toBe(3905) - expect(secondFeedback.isSuccess).isFalse() - expect(secondFeedback.isWarning).isTrue() - expect(secondFeedback.isError).isFalse() - expect(secondFeedback.message).toBe("Es wurde keine Challenge erzeugt.") - expect(secondFeedback.parameter).toBe(null) + assertEquals(3905, secondFeedback.responseCode) + assertFalse(secondFeedback.isSuccess) + assertTrue(secondFeedback.isWarning) + assertFalse(secondFeedback.isError) + assertEquals("Es wurde keine Challenge erzeugt.", secondFeedback.message) + assertEquals(null, secondFeedback.parameter) } @@ -242,7 +240,7 @@ class ResponseParserTest : FinTsTestBase() { // then assertCouldParseSegment(result, InstituteSegmentId.SegmentFeedback, 4, 2, 3) - expect(result.aufsetzpunkt).toBe("9345-10-26-11.52.15.693455") + assertEquals("9345-10-26-11.52.15.693455", result.aufsetzpunkt) } @Test @@ -255,42 +253,41 @@ class ResponseParserTest : FinTsTestBase() { // then assertCouldParseSegment(result, InstituteSegmentId.SegmentFeedback, 4, 2, 4) - expect(result.segmentFeedbacks).hasSize(1) + assertSize(1, result.segmentFeedbacks) - expect(result.supportedTanMethodsForUser).containsExactly(Sicherheitsfunktion.PIN_TAN_910, + assertContainsExactly(result.supportedTanMethodsForUser, Sicherheitsfunktion.PIN_TAN_910, Sicherheitsfunktion.PIN_TAN_911, Sicherheitsfunktion.PIN_TAN_912, Sicherheitsfunktion.PIN_TAN_913) val segmentFeedback = result.segmentFeedbacks.first() - expect(segmentFeedback.feedbacks).hasSize(3) + assertSize(3, segmentFeedback.feedbacks) val firstFeedback = segmentFeedback.feedbacks[0] - expect(firstFeedback.responseCode).toBe(3050) - expect(firstFeedback.isSuccess).isFalse() - expect(firstFeedback.isWarning).isTrue() - expect(firstFeedback.isError).isFalse() - expect(firstFeedback.message).toBe("BPD nicht mehr aktuell, aktuelle Version enthalten.") - expect(firstFeedback.parameter).toBe(null) + assertEquals(3050, firstFeedback.responseCode) + assertFalse(firstFeedback.isSuccess) + assertTrue(firstFeedback.isWarning) + assertFalse(firstFeedback.isError) + assertEquals("BPD nicht mehr aktuell, aktuelle Version enthalten.", firstFeedback.message) + assertEquals(null, firstFeedback.parameter) val secondFeedback = segmentFeedback.feedbacks[1] - expect(secondFeedback is SupportedTanMethodsForUserFeedback).isTrue() - expect((secondFeedback as SupportedTanMethodsForUserFeedback).supportedTanMethods) - .containsExactly(Sicherheitsfunktion.PIN_TAN_910,Sicherheitsfunktion.PIN_TAN_911, + assertTrue(secondFeedback is SupportedTanMethodsForUserFeedback) + assertContainsExactly(secondFeedback.supportedTanMethods, Sicherheitsfunktion.PIN_TAN_910,Sicherheitsfunktion.PIN_TAN_911, Sicherheitsfunktion.PIN_TAN_912, Sicherheitsfunktion.PIN_TAN_913) - expect(secondFeedback.responseCode).toBe(3920) - expect(secondFeedback.isSuccess).isFalse() - expect(secondFeedback.isWarning).isTrue() - expect(secondFeedback.isError).isFalse() - expect(secondFeedback.message).toBe("Zugelassene Zwei-Schritt-Verfahren für den Benutzer.") - expect(secondFeedback.parameter).toBe(null) + assertEquals(3920, secondFeedback.responseCode) + assertFalse(secondFeedback.isSuccess) + assertTrue(secondFeedback.isWarning) + assertFalse(secondFeedback.isError) + assertEquals("Zugelassene Zwei-Schritt-Verfahren für den Benutzer.", secondFeedback.message) + assertEquals(null, secondFeedback.parameter) val thirdFeedback = segmentFeedback.feedbacks[2] - expect(thirdFeedback.responseCode).toBe(20) - expect(thirdFeedback.isSuccess).isTrue() - expect(thirdFeedback.isWarning).isFalse() - expect(thirdFeedback.isError).isFalse() - expect(thirdFeedback.message).toBe("Der Auftrag wurde ausgeführt.") - expect(thirdFeedback.parameter).toBe(null) + assertEquals(20, thirdFeedback.responseCode) + assertTrue(thirdFeedback.isSuccess) + assertFalse(thirdFeedback.isWarning) + assertFalse(thirdFeedback.isError) + assertEquals("Der Auftrag wurde ausgeführt.", thirdFeedback.message) + assertEquals(null, thirdFeedback.parameter) } @@ -304,7 +301,7 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.Synchronization, 173, 4, 6) result.getFirstSegmentById(InstituteSegmentId.Synchronization)?.let { segment -> - expect(segment.customerSystemId).toBe("WL/2/Trhmm0BAAAjIADlyFkXrAQA") + assertEquals("WL/2/Trhmm0BAAAjIADlyFkXrAQA", segment.customerSystemId) } ?: run { fail("No segment of type ReceivedSynchronization found in ${result.receivedSegments}") } } @@ -320,18 +317,18 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.BankParameters, 5, 3, 3) result.getFirstSegmentById(InstituteSegmentId.BankParameters)?.let { segment -> - expect(segment.bpdVersion).toBe(34) - expect(segment.bankCountryCode).toBe(280) - expect(segment.bankCode).toBe("10070000") - expect(segment.bankName).toBe("Deutsche Bank") + assertEquals(34, segment.bpdVersion) + assertEquals(280, segment.bankCountryCode) + assertEquals("10070000", segment.bankCode) + assertEquals("Deutsche Bank", segment.bankName) - expect(segment.countMaxJobsPerMessage).toBe(0) - expect(segment.supportedLanguages).containsExactly(Dialogsprache.German) - expect(segment.supportedHbciVersions).containsExactly(HbciVersion.FinTs_3_0_0) + assertEquals(0, segment.countMaxJobsPerMessage) + assertContainsExactly(segment.supportedLanguages, Dialogsprache.German) + assertContainsExactly(segment.supportedHbciVersions, HbciVersion.FinTs_3_0_0) - expect(segment.maxMessageSize).toBe(0) - expect(segment.minTimeout).toBe(null) - expect(segment.maxTimeout).toBe(null) + assertEquals(0, segment.maxMessageSize) + assertEquals(null, segment.minTimeout) + assertEquals(null, segment.maxTimeout) } ?: run { fail("No segment of type BankParameters found in ${result.receivedSegments}") } } @@ -348,18 +345,18 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.BankParameters, 3, 3, 3) result.getFirstSegmentById(InstituteSegmentId.BankParameters)?.let { segment -> - expect(segment.bpdVersion).toBe(0) - expect(segment.bankCountryCode).toBe(280) - expect(segment.bankCode).toBe("70033100") - expect(segment.bankName).toBe("Baader Bank AG") + assertEquals(0, segment.bpdVersion) + assertEquals(280, segment.bankCountryCode) + assertEquals("70033100", segment.bankCode) + assertEquals("Baader Bank AG", segment.bankName) - expect(segment.countMaxJobsPerMessage).toBe(1) - expect(segment.supportedLanguages).containsExactly(Dialogsprache.German) - expect(segment.supportedHbciVersions).containsExactly(HbciVersion.FinTs_3_0_0) + assertEquals(1, segment.countMaxJobsPerMessage) + assertContainsExactly(segment.supportedLanguages, Dialogsprache.German) + assertContainsExactly(segment.supportedHbciVersions, HbciVersion.FinTs_3_0_0) - expect(segment.maxMessageSize).toBe(null) - expect(segment.minTimeout).toBe(0) - expect(segment.maxTimeout).toBe(300) + assertEquals(null, segment.maxMessageSize) + assertEquals(0, segment.minTimeout) + assertEquals(300, segment.maxTimeout) } ?: run { fail("No segment of type BankParameters found in ${result.receivedSegments}") } } @@ -374,9 +371,9 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.SecurityMethods, 7, 3, 3) result.getFirstSegmentById(InstituteSegmentId.SecurityMethods)?.let { segment -> - expect(segment.mixingAllowed).isFalse() + assertFalse(segment.mixingAllowed) - expect(segment.securityProfiles).contains( + assertContains(segment.securityProfiles, Sicherheitsprofil(Sicherheitsverfahren.RDH, VersionDesSicherheitsverfahrens.Version_1), Sicherheitsprofil(Sicherheitsverfahren.RDH, VersionDesSicherheitsverfahrens.Version_9), Sicherheitsprofil(Sicherheitsverfahren.RDH, VersionDesSicherheitsverfahrens.Version_10), @@ -397,9 +394,9 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.SecurityMethods, 7, 3, 3) result.getFirstSegmentById(InstituteSegmentId.SecurityMethods)?.let { segment -> - expect(segment.mixingAllowed).isFalse() + assertFalse(segment.mixingAllowed) - expect(segment.securityProfiles).contains( + assertContains(segment.securityProfiles, Sicherheitsprofil(Sicherheitsverfahren.RDH, VersionDesSicherheitsverfahrens.Version_1), Sicherheitsprofil(Sicherheitsverfahren.RDH, VersionDesSicherheitsverfahrens.Version_3), Sicherheitsprofil(Sicherheitsverfahren.RDH, VersionDesSicherheitsverfahrens.Version_5), @@ -428,12 +425,12 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.CommunicationInfo, 5, 4, 3) result.getFirstSegmentById(InstituteSegmentId.CommunicationInfo)?.let { segment -> - expect(segment.bankInfo.bankCountryCode).toBe(BankCountryCode) - expect(segment.bankInfo.bankCode).toBe(BankCode) + assertEquals(BankCountryCode, segment.bankInfo.bankCountryCode) + assertEquals(BankCode, segment.bankInfo.bankCode) - expect(segment.defaultLanguage).toBe(language) + assertEquals(language, segment.defaultLanguage) - expect(segment.parameters).containsExactly( + assertContainsExactly(segment.parameters, CommunicationParameter(Kommunikationsdienst.Https, BankFinTsServerAddress), CommunicationParameter(Kommunikationsdienst.TCP_IP, BankFinTsServerAddress) ) @@ -452,11 +449,11 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.UserParameters, 6, 4, 4) result.getFirstSegmentById(InstituteSegmentId.UserParameters)?.let { segment -> - expect(segment.userIdentifier).toBe("3498443795") - expect(segment.updVersion).toBe(34) - expect(segment.areListedJobsBlocked).isTrue() - expect(segment.username).toBe(null) - expect(segment.extension).toBe("PERSNR0010789316542") + assertEquals("3498443795", segment.userIdentifier) + assertEquals(34, segment.updVersion) + assertTrue(segment.areListedJobsBlocked) + assertEquals(null, segment.username) + assertEquals("PERSNR0010789316542", segment.extension) } ?: run { fail("No segment of type UserParameters found in ${result.receivedSegments}") } } @@ -474,20 +471,20 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.AccountInfo, 7, 6, 4) result.getFirstSegmentById(InstituteSegmentId.AccountInfo)?.let { segment -> - expect(segment.accountIdentifier).toBe("0987654321") - expect(segment.subAccountAttribute).toBe(null) - expect(segment.bankCountryCode).toBe(280) - expect(segment.bankCode).toBe("12345678") - expect(segment.iban).toBe("DE11123456780987654321") - expect(segment.customerId).toBe("2197654321") - expect(segment.accountType).toBe(AccountType.Girokonto) - expect(segment.currency).toBe("EUR") - expect(segment.accountHolderName1).toBe("Hans Dampf") - expect(segment.accountHolderName2).toBe(null) - expect(segment.productName).toBe("Sichteinlagen") - expect(segment.accountLimit).toBe(null) - expect(segment.allowedJobNames).hasSize(44) - expect(segment.extension).notToBeNull() + assertEquals("0987654321", segment.accountIdentifier) + assertEquals(null, segment.subAccountAttribute) + assertEquals(280, segment.bankCountryCode) + assertEquals("12345678", segment.bankCode) + assertEquals("DE11123456780987654321", segment.iban) + assertEquals("2197654321", segment.customerId) + assertEquals(AccountType.Girokonto, segment.accountType) + assertEquals("EUR", segment.currency) + assertEquals("Hans Dampf", segment.accountHolderName1) + assertNull(segment.accountHolderName2) + assertEquals("Sichteinlagen", segment.productName) + assertEquals(null, segment.accountLimit) + assertSize(44, segment.allowedJobNames) + assertNotNull(segment.extension) } ?: run { fail("No segment of type AccountInfo found in ${result.receivedSegments}") } } @@ -502,20 +499,20 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.AccountInfo, 74, 6, 3) result.getFirstSegmentById(InstituteSegmentId.AccountInfo)?.let { segment -> - expect(segment.accountIdentifier).toBe("9999999999") - expect(segment.subAccountAttribute).toBe(null) - expect(segment.bankCountryCode).toBe(280) - expect(segment.bankCode).toBe("10070000") - expect(segment.iban).toBe(null) - expect(segment.customerId).toBe("9999999999") - expect(segment.accountType).toBe(null) - expect(segment.currency).toBe(null) - expect(segment.accountHolderName1).toBe("anonym") - expect(segment.accountHolderName2).toBe(null) - expect(segment.productName).toBe(null) - expect(segment.accountLimit).toBe(null) - expect(segment.allowedJobNames).isEmpty() - expect(segment.extension).toBe(null) + assertEquals("9999999999", segment.accountIdentifier) + assertEquals(null, segment.subAccountAttribute) + assertEquals(280, segment.bankCountryCode) + assertEquals("10070000", segment.bankCode) + assertEquals(null, segment.iban) + assertEquals("9999999999", segment.customerId) + assertEquals(null, segment.accountType) + assertEquals(null, segment.currency) + assertEquals("anonym", segment.accountHolderName1) + assertNull(segment.accountHolderName2) + assertEquals(null, segment.productName) + assertEquals(null, segment.accountLimit) + assertEmpty(segment.allowedJobNames) + assertEquals(null, segment.extension) } ?: run { fail("No segment of type AccountInfo found in ${result.receivedSegments}") } } @@ -530,13 +527,13 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.SepaAccountInfo, 5, 1, 3) result.getFirstSegmentById(InstituteSegmentId.SepaAccountInfo)?.let { segment -> - expect(segment.account.isSepaAccount).isTrue() - expect(segment.account.iban).toBe(Iban) - expect(segment.account.bic).toBe(Bic) - expect(segment.account.accountIdentifier).toBe(CustomerId) - expect(segment.account.subAccountAttribute).toBe(null) - expect(segment.account.bankInfo.bankCountryCode).toBe(BankCountryCode) - expect(segment.account.bankInfo.bankCode).toBe(BankCode) + assertTrue(segment.account.isSepaAccount) + assertEquals(Iban, segment.account.iban) + assertEquals(Bic, segment.account.bic) + assertEquals(CustomerId, segment.account.accountIdentifier) + assertEquals(null, segment.account.subAccountAttribute) + assertEquals(BankCountryCode, segment.account.bankInfo.bankCountryCode) + assertEquals(BankCode, segment.account.bankInfo.bankCode) } ?: run { fail("No segment of type SepaAccountInfo found in ${result.receivedSegments}") } } @@ -552,18 +549,18 @@ class ResponseParserTest : FinTsTestBase() { assertCouldParseResponse(result) val sepaAccountInfoParameters = result.getSegmentsById(InstituteSegmentId.SepaAccountInfoParameters) - expect(sepaAccountInfoParameters).hasSize(2) + assertSize(2, sepaAccountInfoParameters) assertCouldParseJobParametersSegment(sepaAccountInfoParameters[0], InstituteSegmentId.SepaAccountInfoParameters, 147, 1, 3, "HKSPA", 1, 1, 1) assertCouldParseJobParametersSegment(sepaAccountInfoParameters[1], InstituteSegmentId.SepaAccountInfoParameters, 148, 2, 3, "HKSPA", 1, 1, 1) for (segment in sepaAccountInfoParameters) { - expect(segment.retrieveSingleAccountAllowed).isTrue() - expect(segment.nationalAccountRelationshipAllowed).isFalse() - expect(segment.structuredReferenceAllowed).isFalse() - expect(segment.settingMaxAllowedEntriesAllowed).isFalse() - expect(segment.countReservedReferenceLength).toBe(SepaAccountInfoParameters.CountReservedReferenceLengthNotSet) - expect(segment.supportedSepaFormats).containsExactly( + assertTrue(segment.retrieveSingleAccountAllowed) + assertFalse(segment.nationalAccountRelationshipAllowed) + assertFalse(segment.structuredReferenceAllowed) + assertFalse(segment.settingMaxAllowedEntriesAllowed) + assertEquals(SepaAccountInfoParameters.CountReservedReferenceLengthNotSet, segment.countReservedReferenceLength) + assertContainsExactly(segment.supportedSepaFormats, "sepade.pain.001.001.02.xsd", "sepade.pain.001.002.02.xsd", "sepade.pain.001.002.03.xsd", @@ -576,7 +573,6 @@ class ResponseParserTest : FinTsTestBase() { } } - @ExperimentalWithOptions @Test fun parseSupportedJobs() { @@ -678,11 +674,11 @@ class ResponseParserTest : FinTsTestBase() { // then - expect(result.successful).isTrue() - expect(result.receivedSegments).hasSize(92) + assertTrue(result.successful) + assertSize(92, result.receivedSegments) for (segment in result.receivedSegments) { - expect(segment is JobParameters).withRepresentation("$segment should be of type JobParameters").isTrue() + assertTrue(segment is JobParameters, "$segment should be of type JobParameters") } } @@ -697,15 +693,15 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.PinInfo, 49, 1, 4) result.getFirstSegmentById(InstituteSegmentId.PinInfo)?.let { segment -> - expect(segment.minPinLength).toBe(5) - expect(segment.maxPinLength).toBe(20) - expect(segment.minTanLength).toBe(6) - expect(segment.userIdHint).toBe("VR-NetKey oder Alias") - expect(segment.customerIdHint).toBe(null) + assertEquals(5, segment.minPinLength) + assertEquals(20, segment.maxPinLength) + assertEquals(6, segment.minTanLength) + assertEquals("VR-NetKey oder Alias", segment.userIdHint) + assertEquals(null, segment.customerIdHint) - expect(segment.jobTanConfiguration).hasSize(37) - expect(segment.jobTanConfiguration.first { it.segmentId == "HKKAZ" }.tanRequired).isTrue() - expect(segment.jobTanConfiguration.first { it.segmentId == "HKSAL" }.tanRequired).isFalse() + assertSize(37, segment.jobTanConfiguration) + assertTrue(segment.jobTanConfiguration.first { it.segmentId == "HKKAZ" }.tanRequired) + assertFalse(segment.jobTanConfiguration.first { it.segmentId == "HKSAL" }.tanRequired) } ?: run { fail("No segment of type PinInfo found in ${result.receivedSegments}") } } @@ -721,16 +717,15 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.TanInfo, 171, 6, 4) result.getFirstSegmentById(InstituteSegmentId.TanInfo)?.let { segment -> - expect(segment.maxCountJobs).toBe(1) - expect(segment.minimumCountSignatures).toBe(1) - expect(segment.securityClass).toBe(1) - expect(segment.tanProcedureParameters.oneStepProcedureAllowed).isTrue() - expect(segment.tanProcedureParameters.moreThanOneTanDependentJobPerMessageAllowed).isFalse() - expect(segment.tanProcedureParameters.jobHashValue).toBe("0") + assertEquals(1, segment.maxCountJobs) + assertEquals(1, segment.minimumCountSignatures) + assertEquals(1, segment.securityClass) + assertTrue(segment.tanProcedureParameters.oneStepProcedureAllowed) + assertFalse(segment.tanProcedureParameters.moreThanOneTanDependentJobPerMessageAllowed) + assertEquals("0", segment.tanProcedureParameters.jobHashValue) - expect(segment.tanProcedureParameters.methodParameters).hasSize(7) - expect(segment.tanProcedureParameters.methodParameters.map { it.methodName }) - .containsExactly("chipTAN manuell", "chipTAN optisch", "chipTAN-USB", "chipTAN-QR", + assertSize(7, segment.tanProcedureParameters.methodParameters) + assertContainsExactly(segment.tanProcedureParameters.methodParameters.map { it.methodName }, "chipTAN manuell", "chipTAN optisch", "chipTAN-USB", "chipTAN-QR", "smsTAN", "pushTAN", "iTAN") } ?: run { fail("No segment of type TanInfo found in ${result.receivedSegments}") } @@ -747,7 +742,7 @@ class ResponseParserTest : FinTsTestBase() { result.getFirstSegmentById(InstituteSegmentId.TanInfo)?.let { segment -> val tanMethodParameters = segment.tanProcedureParameters.methodParameters - expect(tanMethodParameters).hasSize(5) + assertSize(5, tanMethodParameters) assertTanMethodParameter(tanMethodParameters, 0, Sicherheitsfunktion.PIN_TAN_942, DkTanMethod.mobileTAN, "mobile TAN") assertTanMethodParameter(tanMethodParameters, 1, Sicherheitsfunktion.PIN_TAN_944, DkTanMethod.mobileTAN, "SecureGo") @@ -769,7 +764,7 @@ class ResponseParserTest : FinTsTestBase() { result.getFirstSegmentById(InstituteSegmentId.TanInfo)?.let { segment -> val tanMethodParameters = segment.tanProcedureParameters.methodParameters - expect(tanMethodParameters).hasSize(7) + assertSize(7, tanMethodParameters) assertTanMethodParameter(tanMethodParameters, 0, Sicherheitsfunktion.PIN_TAN_910, null, "chipTAN manuell") assertTanMethodParameter(tanMethodParameters, 1, Sicherheitsfunktion.PIN_TAN_911, DkTanMethod.HHDOPT1, "chipTAN optisch") @@ -793,7 +788,7 @@ class ResponseParserTest : FinTsTestBase() { result.getFirstSegmentById(InstituteSegmentId.TanInfo)?.let { segment -> val tanMethodParameters = segment.tanProcedureParameters.methodParameters - expect(tanMethodParameters).hasSize(5) + assertSize(5, tanMethodParameters) assertTanMethodParameter(tanMethodParameters, 0, Sicherheitsfunktion.PIN_TAN_901, null, "SMS-TAN") assertTanMethodParameter(tanMethodParameters, 1, Sicherheitsfunktion.PIN_TAN_904, DkTanMethod.HHDOPT1, "chipTAN comfort") @@ -809,9 +804,9 @@ class ResponseParserTest : FinTsTestBase() { val tanMethodParameters = parsedTanMethodParameters[index] - expect(tanMethodParameters.securityFunction).toBe(securityFunction) - expect(tanMethodParameters.dkTanMethod).toBe(tanMethod) - expect(tanMethodParameters.methodName).toBe(methodName) + assertEquals(securityFunction, tanMethodParameters.securityFunction) + assertEquals(tanMethod, tanMethodParameters.dkTanMethod) + assertEquals(methodName, tanMethodParameters.methodName) } @Test @@ -824,16 +819,15 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.TanInfo, 27, 6, 3) result.getFirstSegmentById(InstituteSegmentId.TanInfo)?.let { segment -> - expect(segment.maxCountJobs).toBe(1) - expect(segment.minimumCountSignatures).toBe(1) - expect(segment.securityClass).toBe(1) - expect(segment.tanProcedureParameters.oneStepProcedureAllowed).isFalse() - expect(segment.tanProcedureParameters.moreThanOneTanDependentJobPerMessageAllowed).isFalse() - expect(segment.tanProcedureParameters.jobHashValue).toBe("0") + assertEquals(1, segment.maxCountJobs) + assertEquals(1, segment.minimumCountSignatures) + assertEquals(1, segment.securityClass) + assertFalse(segment.tanProcedureParameters.oneStepProcedureAllowed) + assertFalse(segment.tanProcedureParameters.moreThanOneTanDependentJobPerMessageAllowed) + assertEquals("0", segment.tanProcedureParameters.jobHashValue) - expect(segment.tanProcedureParameters.methodParameters).hasSize(2) - expect(segment.tanProcedureParameters.methodParameters.map { it.methodName }) - .containsExactly("mobileTAN-Verfahren", "photoTAN-Verfahren") + assertSize(2, segment.tanProcedureParameters.methodParameters) + assertContainsExactly(segment.tanProcedureParameters.methodParameters.map { it.methodName }, "mobileTAN-Verfahren", "photoTAN-Verfahren") } ?: run { fail("No segment of type TanInfo found in ${result.receivedSegments}") } } @@ -848,16 +842,16 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.TanInfo, 56, 6, 3) result.getFirstSegmentById(InstituteSegmentId.TanInfo)?.let { segment -> - expect(segment.maxCountJobs).toBe(1) - expect(segment.minimumCountSignatures).toBe(1) - expect(segment.securityClass).toBe(1) - expect(segment.tanProcedureParameters.oneStepProcedureAllowed).isFalse() - expect(segment.tanProcedureParameters.moreThanOneTanDependentJobPerMessageAllowed).isFalse() - expect(segment.tanProcedureParameters.jobHashValue).toBe("0") + assertEquals(1, segment.maxCountJobs) + assertEquals(1, segment.minimumCountSignatures) + assertEquals(1, segment.securityClass) + assertFalse(segment.tanProcedureParameters.oneStepProcedureAllowed) + assertFalse(segment.tanProcedureParameters.moreThanOneTanDependentJobPerMessageAllowed) + assertEquals("0", segment.tanProcedureParameters.jobHashValue) - expect(segment.tanProcedureParameters.methodParameters).hasSize(5) - expect(segment.tanProcedureParameters.methodParameters.map { it.methodName }) - .containsExactly("SMS-TAN", "chipTAN comfort", "chipTAN comfort manuell", "BV AppTAN", "PhotoTAN") + assertSize(5, segment.tanProcedureParameters.methodParameters) + assertContainsExactly(segment.tanProcedureParameters.methodParameters.map { it.methodName }, + "SMS-TAN", "chipTAN comfort", "chipTAN comfort manuell", "BV AppTAN", "PhotoTAN") } ?: run { fail("No segment of type TanInfo found in ${result.receivedSegments}") } } @@ -872,16 +866,16 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.TanInfo, 33, 7, 3) result.getFirstSegmentById(InstituteSegmentId.TanInfo)?.let { segment -> - expect(segment.maxCountJobs).toBe(1) - expect(segment.minimumCountSignatures).toBe(1) - expect(segment.securityClass).toBe(0) - expect(segment.tanProcedureParameters.oneStepProcedureAllowed).isFalse() - expect(segment.tanProcedureParameters.moreThanOneTanDependentJobPerMessageAllowed).isFalse() - expect(segment.tanProcedureParameters.jobHashValue).toBe("1") + assertEquals(1, segment.maxCountJobs) + assertEquals(1, segment.minimumCountSignatures) + assertEquals(0, segment.securityClass) + assertFalse(segment.tanProcedureParameters.oneStepProcedureAllowed) + assertFalse(segment.tanProcedureParameters.moreThanOneTanDependentJobPerMessageAllowed) + assertEquals("1", segment.tanProcedureParameters.jobHashValue) - expect(segment.tanProcedureParameters.methodParameters).hasSize(6) - expect(segment.tanProcedureParameters.methodParameters.map { it.methodName }) - .containsExactly("iTAN", "mobile TAN", "App-basiertes Verfahren", "chipTAN 1.4", + assertSize(6, segment.tanProcedureParameters.methodParameters) + assertContainsExactly(segment.tanProcedureParameters.methodParameters.map { it.methodName }, + "iTAN", "mobile TAN", "App-basiertes Verfahren", "chipTAN 1.4", "chipTAN 1.4 manuell", "Vorlagen und Informationen") } ?: run { fail("No segment of type TanInfo found in ${result.receivedSegments}") } @@ -897,40 +891,40 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.TanInfo, 177, 7, 4) result.getFirstSegmentById(InstituteSegmentId.TanInfo)?.let { segment -> - expect(segment.maxCountJobs).toBe(1) - expect(segment.minimumCountSignatures).toBe(1) - expect(segment.securityClass).toBe(1) - expect(segment.tanProcedureParameters.oneStepProcedureAllowed).isFalse() - expect(segment.tanProcedureParameters.moreThanOneTanDependentJobPerMessageAllowed).isFalse() - expect(segment.tanProcedureParameters.jobHashValue).toBe("0") + assertEquals(1, segment.maxCountJobs) + assertEquals(1, segment.minimumCountSignatures) + assertEquals(1, segment.securityClass) + assertFalse(segment.tanProcedureParameters.oneStepProcedureAllowed) + assertFalse(segment.tanProcedureParameters.moreThanOneTanDependentJobPerMessageAllowed) + assertEquals("0", segment.tanProcedureParameters.jobHashValue) - expect(segment.tanProcedureParameters.methodParameters).hasSize(1) + assertSize(1, segment.tanProcedureParameters.methodParameters) val decoupledPushTanMethod = segment.tanProcedureParameters.methodParameters.first() - expect(decoupledPushTanMethod.securityFunction).toBe(Sicherheitsfunktion.PIN_TAN_922) - expect(decoupledPushTanMethod.tanProcess).toBe(TanProcess.TanProcess2) - expect(decoupledPushTanMethod.technicalTanMethodIdentification).toBe("pushTAN-dec") - expect(decoupledPushTanMethod.dkTanMethod).toBe(DkTanMethod.Decoupled) - expect(decoupledPushTanMethod.versionDkTanMethod).toBe(null) - expect(decoupledPushTanMethod.methodName).toBe("pushTAN 2.0") - expect(decoupledPushTanMethod.maxTanInputLength).toBe(null) - expect(decoupledPushTanMethod.allowedTanFormat).toBe(null) + assertEquals(Sicherheitsfunktion.PIN_TAN_922, decoupledPushTanMethod.securityFunction) + assertEquals(TanProcess.TanProcess2, decoupledPushTanMethod.tanProcess) + assertEquals("pushTAN-dec", decoupledPushTanMethod.technicalTanMethodIdentification) + assertEquals(DkTanMethod.Decoupled, decoupledPushTanMethod.dkTanMethod) + assertEquals(null, decoupledPushTanMethod.versionDkTanMethod) + assertEquals("pushTAN 2.0", decoupledPushTanMethod.methodName) + assertEquals(null, decoupledPushTanMethod.maxTanInputLength) + assertEquals(null, decoupledPushTanMethod.allowedTanFormat) - expect(decoupledPushTanMethod.descriptionToShowToUser).toBe("Aufforderung") - expect(decoupledPushTanMethod.maxReturnValueLength).toBe(2048) - expect(decoupledPushTanMethod.multipleTansAllowed).toBe(true) - expect(decoupledPushTanMethod.timeAndDialogRelation).toBe(TanZeitUndDialogbezug.TanZeitversetztDialoguebergreifendErlaubt) - expect(decoupledPushTanMethod.cancellationAllowed).toBe(false) + assertEquals("Aufforderung", decoupledPushTanMethod.descriptionToShowToUser) + assertEquals(2048, decoupledPushTanMethod.maxReturnValueLength) + assertEquals(true, decoupledPushTanMethod.multipleTansAllowed) + assertEquals(TanZeitUndDialogbezug.TanZeitversetztDialoguebergreifendErlaubt, decoupledPushTanMethod.timeAndDialogRelation) + assertEquals(false, decoupledPushTanMethod.cancellationAllowed) - expect(decoupledPushTanMethod.nameOfTanMediumRequired).toBe(BezeichnungDesTanMediumsErforderlich.BezeichnungDesTanMediumsMussAngegebenWerden) - expect(decoupledPushTanMethod.countSupportedActiveTanMedia).toBe(2) + assertEquals(BezeichnungDesTanMediumsErforderlich.BezeichnungDesTanMediumsMussAngegebenWerden, decoupledPushTanMethod.nameOfTanMediumRequired) + assertEquals(2, decoupledPushTanMethod.countSupportedActiveTanMedia) - expect(decoupledPushTanMethod.maxNumberOfStateRequestsForDecoupled).toBe(180) - expect(decoupledPushTanMethod.initialDelayInSecondsForStateRequestsForDecoupled).toBe(1) - expect(decoupledPushTanMethod.delayInSecondsForNextStateRequestsForDecoupled).toBe(1) - expect(decoupledPushTanMethod.manualConfirmationAllowedForDecoupled).toBe(true) - expect(decoupledPushTanMethod.periodicStateRequestsAllowedForDecoupled).toBe(true) + assertEquals(180, decoupledPushTanMethod.maxNumberOfStateRequestsForDecoupled) + assertEquals(1, decoupledPushTanMethod.initialDelayInSecondsForStateRequestsForDecoupled) + assertEquals(1, decoupledPushTanMethod.delayInSecondsForNextStateRequestsForDecoupled) + assertEquals(true, decoupledPushTanMethod.manualConfirmationAllowedForDecoupled) + assertEquals(true, decoupledPushTanMethod.periodicStateRequestsAllowedForDecoupled) } ?: run { fail("No segment of type TanInfo found in ${result.receivedSegments}") } } @@ -944,16 +938,16 @@ class ResponseParserTest : FinTsTestBase() { // then assertSuccessfullyParsedSegment(result, InstituteSegmentId.Tan, 6, 6, 5) - expect(result.isStrongAuthenticationRequired).isFalse() + assertFalse(result.isStrongAuthenticationRequired) result.getFirstSegmentById(InstituteSegmentId.Tan)?.let { segment -> - expect(segment.tanProcess).toBe(TanProcess.TanProcess4) - expect(segment.jobHashValue).toBe(null) - expect(segment.jobReference).toBe(TanResponse.NoJobReferenceResponse) - expect(segment.challenge).toBe(TanResponse.NoChallengeResponse) - expect(segment.challengeHHD_UC).toBe(null) - expect(segment.validityDateTimeForChallenge).toBe(null) - expect(segment.tanMediaIdentifier).toBe(null) + assertEquals(TanProcess.TanProcess4, segment.tanProcess) + assertEquals(null, segment.jobHashValue) + assertEquals(TanResponse.NoJobReferenceResponse, segment.jobReference) + assertEquals(TanResponse.NoChallengeResponse, segment.challenge) + assertNull(segment.challengeHHD_UC) + assertEquals(null, segment.validityDateTimeForChallenge) + assertEquals(null, segment.tanMediaIdentifier) } ?: run { fail("No segment of type TanResponse found in ${result.receivedSegments}") } } @@ -973,16 +967,16 @@ class ResponseParserTest : FinTsTestBase() { // then assertSuccessfullyParsedSegment(result, InstituteSegmentId.Tan, 5, 6, 4) - expect(result.isStrongAuthenticationRequired).isTrue() + assertTrue(result.isStrongAuthenticationRequired) result.getFirstSegmentById(InstituteSegmentId.Tan)?.let { segment -> - expect(segment.tanProcess).toBe(TanProcess.TanProcess4) - expect(segment.jobHashValue).toBe(null) - expect(segment.jobReference).toBe(jobReference) - expect(segment.challenge).toBe(unmaskString(challenge)) - expect(segment.challengeHHD_UC).toBe(challengeHHD_UC) - expect(segment.validityDateTimeForChallenge).toBe(null) - expect(segment.tanMediaIdentifier).toBe(tanMediaIdentifier) + assertEquals(TanProcess.TanProcess4, segment.tanProcess) + assertEquals(null, segment.jobHashValue) + assertEquals(jobReference, segment.jobReference) + assertEquals(unmaskString(challenge), segment.challenge) + assertEquals(challengeHHD_UC, segment.challengeHHD_UC) + assertEquals(null, segment.validityDateTimeForChallenge) + assertEquals(tanMediaIdentifier, segment.tanMediaIdentifier) } ?: run { fail("No segment of type TanResponse found in ${result.receivedSegments}") } } @@ -1002,11 +996,11 @@ class ResponseParserTest : FinTsTestBase() { // then assertSuccessfullyParsedSegment(result, InstituteSegmentId.TanMediaList, 5, 4, 3) - expect(result.isStrongAuthenticationRequired).isFalse() + assertFalse(result.isStrongAuthenticationRequired) result.getFirstSegmentById(InstituteSegmentId.TanMediaList)?.let { segment -> - expect(segment.usageOption).toBe(TanEinsatzOption.KundeKannGenauEinMediumZuEinerZeitNutzen) - expect(segment.tanMedia).containsExactly( + assertEquals(TanEinsatzOption.KundeKannGenauEinMediumZuEinerZeitNutzen, segment.usageOption) + assertContainsExactly(segment.tanMedia, TanGeneratorTanMedium(TanMediumKlasse.TanGenerator, TanMediumStatus.AktivFolgekarte, oldCardNumber, cardSequenceNumber, null, null, null, mediaName), TanGeneratorTanMedium(TanMediumKlasse.TanGenerator, TanMediumStatus.Verfuegbar, cardSequenceNumber, null, null, null, null, mediaName) ) @@ -1026,16 +1020,16 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.ChangeTanMediaParameters, 64, 1, 3) result.getFirstSegmentById(InstituteSegmentId.ChangeTanMediaParameters)?.let { segment -> - expect(segment.maxCountJobs).toBe(1) - expect(segment.minimumCountSignatures).toBe(1) - expect(segment.securityClass).toBe(1) + assertEquals(1, segment.maxCountJobs) + assertEquals(1, segment.minimumCountSignatures) + assertEquals(1, segment.securityClass) - expect(segment.enteringTanListNumberRequired).isTrue() - expect(segment.enteringCardSequenceNumberRequired).isFalse() - expect(segment.enteringAtcAndTanRequired).isTrue() - expect(segment.enteringCardTypeAllowed).isFalse() - expect(segment.accountInfoRequired).isFalse() - expect(segment.allowedCardTypes).isEmpty() + assertTrue(segment.enteringTanListNumberRequired) + assertFalse(segment.enteringCardSequenceNumberRequired) + assertTrue(segment.enteringAtcAndTanRequired) + assertFalse(segment.enteringCardTypeAllowed) + assertFalse(segment.accountInfoRequired) + assertEmpty(segment.allowedCardTypes) } ?: run { fail("No segment of type ChangeTanMediaParameters found in ${result.receivedSegments}") } } @@ -1050,16 +1044,16 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.ChangeTanMediaParameters, 64, 2, 3) result.getFirstSegmentById(InstituteSegmentId.ChangeTanMediaParameters)?.let { segment -> - expect(segment.maxCountJobs).toBe(1) - expect(segment.minimumCountSignatures).toBe(1) - expect(segment.securityClass).toBe(1) + assertEquals(1, segment.maxCountJobs) + assertEquals(1, segment.minimumCountSignatures) + assertEquals(1, segment.securityClass) - expect(segment.enteringTanListNumberRequired).isFalse() - expect(segment.enteringCardSequenceNumberRequired).isTrue() - expect(segment.enteringAtcAndTanRequired).isFalse() - expect(segment.enteringCardTypeAllowed).isTrue() - expect(segment.accountInfoRequired).isFalse() - expect(segment.allowedCardTypes).containsExactly(11, 13, 15, 17) + assertFalse(segment.enteringTanListNumberRequired) + assertTrue(segment.enteringCardSequenceNumberRequired) + assertFalse(segment.enteringAtcAndTanRequired) + assertTrue(segment.enteringCardTypeAllowed) + assertFalse(segment.accountInfoRequired) + assertContainsExactly(segment.allowedCardTypes, 11, 13, 15, 17) } ?: run { fail("No segment of type ChangeTanMediaParameters found in ${result.receivedSegments}") } } @@ -1074,16 +1068,16 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.ChangeTanMediaParameters, 64, 3, 3) result.getFirstSegmentById(InstituteSegmentId.ChangeTanMediaParameters)?.let { segment -> - expect(segment.maxCountJobs).toBe(1) - expect(segment.minimumCountSignatures).toBe(1) - expect(segment.securityClass).toBe(1) + assertEquals(1, segment.maxCountJobs) + assertEquals(1, segment.minimumCountSignatures) + assertEquals(1, segment.securityClass) - expect(segment.enteringTanListNumberRequired).isFalse() - expect(segment.enteringCardSequenceNumberRequired).isTrue() - expect(segment.enteringAtcAndTanRequired).isFalse() - expect(segment.enteringCardTypeAllowed).isTrue() - expect(segment.accountInfoRequired).isTrue() - expect(segment.allowedCardTypes).containsExactly(11, 13, 15, 17) + assertFalse(segment.enteringTanListNumberRequired) + assertTrue(segment.enteringCardSequenceNumberRequired) + assertFalse(segment.enteringAtcAndTanRequired) + assertTrue(segment.enteringCardTypeAllowed) + assertTrue(segment.accountInfoRequired) + assertContainsExactly(segment.allowedCardTypes, 11, 13, 15, 17) } ?: run { fail("No segment of type ChangeTanMediaParameters found in ${result.receivedSegments}") } } @@ -1107,11 +1101,11 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.Balance, 8, 5, 3) result.getFirstSegmentById(InstituteSegmentId.Balance)?.let { segment -> - expect(segment.balance).toBe(Amount(balance)) - expect(segment.currency).toBe("EUR") - expect(segment.date).toBe(date) - expect(segment.accountProductName).toBe(accountProductName) - expect(segment.balanceOfPreBookedTransactions).toBe(null) + assertEquals(Amount(balance), segment.balance) + assertEquals("EUR", segment.currency) + assertEquals(date, segment.date) + assertEquals(accountProductName, segment.accountProductName) + assertEquals(null, segment.balanceOfPreBookedTransactions) } ?: run { fail("No segment of type BalanceSegment found in ${result.receivedSegments}") } } @@ -1134,11 +1128,11 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.Balance, 7, 5, 3) result.getFirstSegmentById(InstituteSegmentId.Balance)?.let { segment -> - expect(segment.balance).toBe(balance) - expect(segment.currency).toBe("EUR") - expect(segment.date).toBe(date) - expect(segment.accountProductName).toBe(accountProductName) - expect(segment.balanceOfPreBookedTransactions).toBe(null) + assertEquals(balance, segment.balance) + assertEquals("EUR", segment.currency) + assertEquals(date, segment.date) + assertEquals(accountProductName, segment.accountProductName) + assertEquals(null, segment.balanceOfPreBookedTransactions) } ?: run { fail("No segment of type BalanceSegment found in ${result.receivedSegments}") } } @@ -1161,11 +1155,11 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.Balance, 7, 5, 3) result.getFirstSegmentById(InstituteSegmentId.Balance)?.let { segment -> - expect(segment.balance).toBe(balance) - expect(segment.currency).toBe("EUR") - expect(segment.date).toBe(date) - expect(segment.accountProductName).toBe(accountProductName) - expect(segment.balanceOfPreBookedTransactions).toBe(null) + assertEquals(balance, segment.balance) + assertEquals("EUR", segment.currency) + assertEquals(date, segment.date) + assertEquals(accountProductName, segment.accountProductName) + assertEquals(null, segment.balanceOfPreBookedTransactions) } ?: run { fail("No segment of type BalanceSegment found in ${result.receivedSegments}") } } @@ -1184,9 +1178,9 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.AccountTransactionsMt940Parameters, 21, 4, 4) result.getFirstSegmentById(InstituteSegmentId.AccountTransactionsMt940Parameters)?.let { segment -> - expect(segment.countDaysForWhichTransactionsAreKept).toBe(countDaysForWhichTransactionsAreKept) - expect(segment.settingCountEntriesAllowed).isFalse() - expect(segment.settingAllAccountAllowed).isFalse() + assertEquals(countDaysForWhichTransactionsAreKept, segment.countDaysForWhichTransactionsAreKept) + assertFalse(segment.settingCountEntriesAllowed) + assertFalse(segment.settingAllAccountAllowed) } ?: run { fail("No segment of type AccountTransactionsMt940Parameters found in ${result.receivedSegments}") } } @@ -1204,9 +1198,9 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.AccountTransactionsMt940Parameters, 23, 6, 4) result.getFirstSegmentById(InstituteSegmentId.AccountTransactionsMt940Parameters)?.let { segment -> - expect(segment.countDaysForWhichTransactionsAreKept).toBe(countDaysForWhichTransactionsAreKept) - expect(segment.settingCountEntriesAllowed).isFalse() - expect(segment.settingAllAccountAllowed).isFalse() + assertEquals(countDaysForWhichTransactionsAreKept, segment.countDaysForWhichTransactionsAreKept) + assertFalse(segment.settingCountEntriesAllowed) + assertFalse(segment.settingAllAccountAllowed) } ?: run { fail("No segment of type AccountTransactionsMt940Parameters found in ${result.receivedSegments}") } } @@ -1230,18 +1224,18 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.CreditCardTransactions, 7, 2, 3) result.getFirstSegmentById(InstituteSegmentId.CreditCardTransactions)?.let { segment -> - expect(segment.balance.amount.string).toBe(balance) - expect(segment.balance.date).toBe(LocalDate(2020, 9, 23)) - expect(segment.balance.time).notToBeNull() - expect(segment.transactions.size).toBe(2) + assertEquals(balance, segment.balance.amount.string) + assertEquals(LocalDate(2020, 9, 23), segment.balance.date) + assertNotNull(segment.balance.time) + assertEquals(2, segment.transactions.size) segment.transactions.forEach { transaction -> - expect(transaction.transactionDescriptionBase).toBe(otherPartyName) - expect(transaction.bookingDate).toBe(LocalDate(2020, 8, 19)) - expect(transaction.valueDate).toBe(LocalDate(2020, 8, 20)) - expect(transaction.amount.amount.string).toBe("-" + amount) - expect(transaction.amount.currency.code).toBe("EUR") - expect(transaction.isCleared).isTrue() + assertEquals(otherPartyName, transaction.transactionDescriptionBase) + assertEquals(LocalDate(2020, 8, 19), transaction.bookingDate) + assertEquals(LocalDate(2020, 8, 20), transaction.valueDate) + assertEquals("-" + amount, transaction.amount.amount.string) + assertEquals("EUR", transaction.amount.currency.code) + assertTrue(transaction.isCleared) } } ?: run { fail("No segment of type ReceivedCreditCardTransactionsAndBalance found in ${result.receivedSegments}") } @@ -1263,11 +1257,11 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.CreditCardTransactions, 7, 2, 3) result.getFirstSegmentById(InstituteSegmentId.CreditCardTransactions)?.let { segment -> - expect(segment.balance.amount.string).toBe(balance) - expect(segment.balance.date).toBe(LocalDate(2020, 9, 23)) - expect(segment.balance.time).notToBeNull() + assertEquals(balance, segment.balance.amount.string) + assertEquals(LocalDate(2020, 9, 23), segment.balance.date) + assertNotNull(segment.balance.time) - expect(segment.transactions).isEmpty() + assertEmpty(segment.transactions) } ?: run { fail("No segment of type ReceivedCreditCardTransactionsAndBalance found in ${result.receivedSegments}") } } @@ -1285,9 +1279,9 @@ class ResponseParserTest : FinTsTestBase() { assertSuccessfullyParsedSegment(result, InstituteSegmentId.CreditCardTransactionsParameters, 15, 2, 4) result.getFirstSegmentById(InstituteSegmentId.CreditCardTransactionsParameters)?.let { segment -> - expect(segment.countDaysForWhichTransactionsAreKept).toBe(countDaysForWhichTransactionsAreKept) - expect(segment.settingCountEntriesAllowed).isTrue() - expect(segment.settingAllAccountAllowed).isTrue() + assertEquals(countDaysForWhichTransactionsAreKept, segment.countDaysForWhichTransactionsAreKept) + assertTrue(segment.settingCountEntriesAllowed) + assertTrue(segment.settingAllAccountAllowed) } ?: run { fail("No segment of type CreditCardTransactionsParameters found in ${result.receivedSegments}") } } @@ -1302,11 +1296,11 @@ class ResponseParserTest : FinTsTestBase() { } private fun assertCouldParseResponse(result: BankResponse) { - expect(result.successful).isTrue() - expect(result.responseContainsErrors).isFalse() - expect(result.internalError).toBe(null) - expect(result.errorsToShowToUser).isEmpty() - expect(result.receivedResponse).notToBeNull() + assertTrue(result.successful) + assertFalse(result.responseContainsErrors) + assertNull(result.internalError) + assertEmpty(result.errorsToShowToUser) + assertNotNull(result.receivedResponse) } private fun assertCouldParseSegment(result: BankResponse, segmentId: ISegmentId, segmentNumber: Int, @@ -1320,13 +1314,13 @@ class ResponseParserTest : FinTsTestBase() { private fun assertCouldParseSegment(segment: ReceivedSegment?, segmentId: ISegmentId, segmentNumber: Int, segmentVersion: Int, referenceSegmentNumber: Int?) { - expect(segment).notToBeNull() + assertNotNull(segment) segment?.let { - expect(segment.segmentId).toBe(segmentId.id) - expect(segment.segmentNumber).toBe(segmentNumber) - expect(segment.segmentVersion).toBe(segmentVersion) - expect(segment.referenceSegmentNumber).toBe(referenceSegmentNumber) + assertEquals(segmentId.id, segment.segmentId) + assertEquals(segmentNumber, segment.segmentNumber) + assertEquals(segmentVersion, segment.segmentVersion) + assertEquals(referenceSegmentNumber, segment.referenceSegmentNumber) } } @@ -1337,11 +1331,15 @@ class ResponseParserTest : FinTsTestBase() { assertCouldParseSegment(segment, segmentId, segmentNumber, segmentVersion, referenceSegmentNumber) segment?.let { - expect(segment.jobName).toBe(jobName) - expect(segment.maxCountJobs).toBe(maxCountJobs) - expect(segment.minimumCountSignatures).toBe(minimumCountSignatures) - expect(segment.securityClass).toBe(securityClass) + assertEquals(jobName, segment.jobName) + assertEquals(maxCountJobs, segment.maxCountJobs) + assertEquals(minimumCountSignatures, segment.minimumCountSignatures) + assertEquals(securityClass, segment.securityClass) } } + private fun assertCountFeedbacks(response: BankResponse, expectedCountFeedbacks: Int) { + assertSize(expectedCountFeedbacks, response.messageFeedback?.feedbacks ?: listOf()) + } + } \ No newline at end of file diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/tan/FlickerCodeDecoderTest.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/tan/FlickerCodeDecoderTest.kt index de7b7d2f..55ca490d 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/tan/FlickerCodeDecoderTest.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/tan/FlickerCodeDecoderTest.kt @@ -1,9 +1,8 @@ package net.dankito.banking.fints.tan -import ch.tutteli.atrium.api.fluent.en_GB.toBe -import ch.tutteli.atrium.api.verbs.expect import net.dankito.banking.fints.model.HHDVersion import kotlin.test.Test +import kotlin.test.assertEquals class FlickerCodeDecoderTest { @@ -23,7 +22,7 @@ class FlickerCodeDecoderTest { // then - expect(response.parsedDataSet).toBe("070520829019981A") + assertEquals("070520829019981A", response.parsedDataSet) } @@ -39,7 +38,7 @@ class FlickerCodeDecoderTest { // then - expect(response.parsedDataSet).toBe("100520829019981849453939424F46494B") + assertEquals("100520829019981849453939424F46494B", response.parsedDataSet) } @Test @@ -52,7 +51,7 @@ class FlickerCodeDecoderTest { val result = underTest.decodeChallenge(challenge, HHDVersion.HHD_1_3) // then - expect(result.parsedDataSet).toBe("1204881696280598765432101533322C30303A") + assertEquals("1204881696280598765432101533322C30303A", result.parsedDataSet) } @Test @@ -65,7 +64,7 @@ class FlickerCodeDecoderTest { val result = underTest.decodeChallenge(challenge, HHDVersion.HHD_1_3) // then - expect(result.parsedDataSet).toBe("0604800402430B") + assertEquals("0604800402430B", result.parsedDataSet) } @@ -79,7 +78,7 @@ class FlickerCodeDecoderTest { val result = underTest.decodeChallenge(challenge, HHDVersion.HHD_1_4) // then - expect(result.parsedDataSet).toBe("1F85012392301246564445323631323334353637383039383736353433323175") + assertEquals("1F85012392301246564445323631323334353637383039383736353433323175", result.parsedDataSet) } @Test @@ -92,7 +91,7 @@ class FlickerCodeDecoderTest { val result = underTest.decodeChallenge(challenge, HHDVersion.HHD_1_4) // then - expect(result.parsedDataSet).toBe("2584011093744F5644453236313233343536373830393837363534333231463130302C303008") + assertEquals("2584011093744F5644453236313233343536373830393837363534333231463130302C303008", result.parsedDataSet) } } \ No newline at end of file diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/transactions/Mt940ParserTest.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/transactions/Mt940ParserTest.kt index 69b741d5..d037a219 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/transactions/Mt940ParserTest.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/transactions/Mt940ParserTest.kt @@ -1,21 +1,16 @@ package net.dankito.banking.fints.transactions -import ch.tutteli.atrium.api.fluent.en_GB.hasSize -import ch.tutteli.atrium.api.fluent.en_GB.notToBeNull -import ch.tutteli.atrium.api.fluent.en_GB.toBe import net.dankito.banking.fints.FinTsTestBase import net.dankito.banking.fints.transactions.mt940.Mt940Parser import net.dankito.banking.fints.transactions.mt940.model.Balance import net.dankito.banking.fints.transactions.mt940.model.InformationToAccountOwner import net.dankito.banking.fints.transactions.mt940.model.StatementLine -import ch.tutteli.atrium.api.verbs.expect import kotlinx.datetime.LocalDate -import kotlin.test.Test -import net.dankito.banking.fints.extensions.isFalse -import net.dankito.banking.fints.extensions.isTrue +import net.dankito.banking.fints.extensions.* import net.dankito.banking.fints.model.Amount -import net.dankito.utils.multiplatform.DateFormatter -import net.dankito.utils.multiplatform.extensions.format +import net.dankito.utils.multiplatform.extensions.toStringWithTwoDigits +import kotlin.test.Test +import kotlin.test.assertContains class Mt940ParserTest : FinTsTestBase() { @@ -57,16 +52,16 @@ class Mt940ParserTest : FinTsTestBase() { // then - expect(result).hasSize(1) + assertSize(1, result) val statement = result.first() - expect(statement.bankCodeBicOrIban).toBe(BankCode) - expect(statement.accountIdentifier).toBe(CustomerId) + assertEquals(BankCode, statement.bankCodeBicOrIban) + assertEquals(CustomerId, statement.accountIdentifier) assertBalance(statement.openingBalance, true, AccountStatement1PreviousStatementBookingDate, AccountStatement1OpeningBalanceAmount) assertBalance(statement.closingBalance, true, AccountStatement1BookingDate, AccountStatement1ClosingBalanceAmount) - expect(statement.transactions).hasSize(1) + assertSize(1, statement.transactions) val transaction = statement.transactions.first() assertTurnover(transaction.statementLine, AccountStatement1BookingDate, AccountStatement1Transaction1Amount) @@ -87,19 +82,19 @@ class Mt940ParserTest : FinTsTestBase() { // then - expect(result).hasSize(1) + assertSize(1, result) val statement = result.first() - expect(statement.bankCodeBicOrIban).toBe(BankCode) - expect(statement.accountIdentifier).toBe(CustomerId) - expect(statement.statementNumber).toBe(0) - expect(statement.sequenceNumber).toBe(null) + assertEquals(BankCode, statement.bankCodeBicOrIban) + assertEquals(CustomerId, statement.accountIdentifier) + assertEquals(0, statement.statementNumber) + assertNull(statement.sequenceNumber) assertBalance(statement.openingBalance, true, bookingDate, Amount("0,00")) assertBalance(statement.closingBalance, isCredit, bookingDate, amount) - expect(statement.transactions).hasSize(1) + assertSize(1, statement.transactions) val transaction = statement.transactions.first() assertTurnover(transaction.statementLine, bookingDate, amount, isCredit) @@ -114,16 +109,16 @@ class Mt940ParserTest : FinTsTestBase() { // then - expect(result).hasSize(1) + assertSize(1, result) val statement = result.first() - expect(statement.bankCodeBicOrIban).toBe(BankCode) - expect(statement.accountIdentifier).toBe(CustomerId) + assertEquals(BankCode, statement.bankCodeBicOrIban) + assertEquals(CustomerId, statement.accountIdentifier) assertBalance(statement.openingBalance, true, AccountStatement1PreviousStatementBookingDate, AccountStatement1OpeningBalanceAmount) assertBalance(statement.closingBalance, true, AccountStatement1BookingDate, AccountStatement1With2TransactionsClosingBalanceAmount) - expect(statement.transactions).hasSize(2) + assertSize(2, statement.transactions) val firstTransaction = statement.transactions.first() assertTurnover(firstTransaction.statementLine, AccountStatement1BookingDate, AccountStatement1Transaction1Amount) @@ -158,13 +153,17 @@ class Mt940ParserTest : FinTsTestBase() { // then - expect(result).hasSize(1) - expect(result.first().transactions).hasSize(2) + assertSize(1, result) + assertSize(2, result.first().transactions) - expect(result.first().transactions[0].statementLine.bookingDate).toBe(LocalDate(2019, 12, 30)) - expect(result.first().transactions[0].statementLine.valueDate).toBe(LocalDate(2020, 1, 1)) - expect(result.first().transactions[1].statementLine.bookingDate).toBe(LocalDate(2019, 12, 30)) - expect(result.first().transactions[1].statementLine.valueDate).toBe(LocalDate(2020, 1, 1)) + result.first().transactions[0].statementLine.apply { + assertEquals(LocalDate(2019, 12, 30), bookingDate) + assertEquals(LocalDate(2020, 1, 1), valueDate) + } + result.first().transactions[1].statementLine.apply { + assertEquals(LocalDate(2019, 12, 30), bookingDate) + assertEquals(LocalDate(2020, 1, 1), valueDate) + } } @Test @@ -226,8 +225,8 @@ class Mt940ParserTest : FinTsTestBase() { // then - expect(result).hasSize(3) - expect(result.flatMap { it.transactions }).hasSize(7) + assertSize(3, result) + assertSize(7, result.flatMap { it.transactions }) } @Test @@ -265,22 +264,22 @@ class Mt940ParserTest : FinTsTestBase() { // then - expect(result).hasSize(1) - expect(result.flatMap { it.transactions }).hasSize(3) + assertSize(1, result) + assertSize(3, result.flatMap { it.transactions }) result.flatMap { it.transactions }.forEach { transaction -> - expect(transaction.information).notToBeNull() + assertNotNull(transaction.information) - expect(transaction.information?.sepaReference).notToBeNull() + assertNotNull(transaction.information?.sepaReference) if (transaction.information?.unparsedReference?.contains("KREF+") == true) { - expect(transaction.information?.customerReference).notToBeNull() + assertNotNull(transaction.information?.customerReference) } } } @Test - fun `Fix that ?, gets detected as field code`() { + fun `Fix that questionmark, gets detected as field code`() { val transactionsString = """ :20:STARTUMS :25:$BankCode/$CustomerId @@ -302,43 +301,45 @@ class Mt940ParserTest : FinTsTestBase() { // then - expect(result).hasSize(1) - expect(result.first().transactions).hasSize(1) + assertSize(1, result) + assertSize(1, result.first().transactions) - expect(result.first().transactions[0].information?.bookingText).toBe("BASISLASTSCHRIFT") - expect(result.first().transactions[0].information?.otherPartyBankCode).toBe("TUBDDEDD") - expect(result.first().transactions[0].information?.otherPartyAccountId).toBe("DE87300308801234567890") - expect(result.first().transactions[0].information?.endToEndReference).toBe("6MKL2OT30QENNLIU") - expect(result.first().transactions[0].information?.mandateReference).toBe("?,3SQNdUbxm9z7dB)+gKYDJAKzCM0G") - expect(result.first().transactions[0].information?.sepaReference?.contains("IBAN: DE87300308801234567890 BIC: TUBDDEDD") ?: false).isTrue() + result.first().transactions[0].information?.apply { + assertEquals("BASISLASTSCHRIFT", bookingText) + assertEquals("TUBDDEDD", otherPartyBankCode) + assertEquals("DE87300308801234567890", otherPartyAccountId) + assertEquals("6MKL2OT30QENNLIU", endToEndReference) + assertEquals("?,3SQNdUbxm9z7dB)+gKYDJAKzCM0G", mandateReference) + assertContains(sepaReference ?: "", "IBAN: DE87300308801234567890 BIC: TUBDDEDD") + } } private fun assertBalance(balance: Balance, isCredit: Boolean, bookingDate: LocalDate, amount: Amount) { - expect(balance.isCredit).toBe(isCredit) - expect(balance.bookingDate).toBe(bookingDate) - expect(balance.amount).toBe(amount) - expect(balance.currency).toBe(Currency) + assertEquals(isCredit, balance.isCredit) + assertEquals(bookingDate, balance.bookingDate) + assertEquals(amount, balance.amount) + assertEquals(Currency, balance.currency) } private fun assertTurnover(statementLine: StatementLine, valueDate: LocalDate, amount: Amount, isCredit: Boolean = true, bookingDate: LocalDate? = valueDate) { - expect(statementLine.isCredit).toBe(isCredit) - expect(statementLine.isReversal).isFalse() - expect(statementLine.valueDate).toBe(valueDate) - expect(statementLine.bookingDate).toBe(bookingDate) - expect(statementLine.amount).toBe(amount) + assertEquals(isCredit, statementLine.isCredit) + assertFalse(statementLine.isReversal) + assertEquals(valueDate, statementLine.valueDate) + assertEquals(bookingDate, statementLine.bookingDate) + assertEquals(amount, statementLine.amount) } private fun assertTransactionDetails(details: InformationToAccountOwner?, otherPartyName: String, otherPartyBankCode: String, otherPartyAccountId: String) { - expect(details).notToBeNull() + assertNotNull(details) - expect(details?.otherPartyName).toBe(otherPartyName) - expect(details?.otherPartyBankCode).toBe(otherPartyBankCode) - expect(details?.otherPartyAccountId).toBe(otherPartyAccountId) + assertEquals(otherPartyName, details.otherPartyName) + assertEquals(otherPartyBankCode, details.otherPartyBankCode) + assertEquals(otherPartyAccountId, details.otherPartyAccountId) } diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/util/Base64Test.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/util/Base64Test.kt index 91779725..057242a7 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/util/Base64Test.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/util/Base64Test.kt @@ -1,12 +1,9 @@ package net.dankito.banking.fints.util -import ch.tutteli.atrium.api.fluent.en_GB.ExperimentalWithOptions -import ch.tutteli.atrium.api.fluent.en_GB.toBe -import ch.tutteli.atrium.api.fluent.en_GB.withRepresentation -import ch.tutteli.atrium.api.verbs.expect import net.dankito.utils.multiplatform.extensions.randomWithSeed import kotlin.random.Random import kotlin.test.Test +import kotlin.test.assertEquals class Base64Test { @@ -31,7 +28,7 @@ class Base64Test { private fun testEncode(input: String, expectedOutput: String) { val actualOutput = underTest.encode(input) - expect(actualOutput).toBe(expectedOutput) + assertEquals(expectedOutput, actualOutput) } @@ -52,12 +49,11 @@ class Base64Test { private fun testDecode(input: String, expectedOutput: String) { val actualOutput = underTest.decode(input) - expect(actualOutput).toBe(expectedOutput) + assertEquals(expectedOutput, actualOutput) } @Test - @ExperimentalWithOptions fun testRandomStrings() { val steps = 1000000 val random = randomWithSeed() @@ -74,7 +70,7 @@ class Base64Test { // then - expect(decoded).withRepresentation { "Decoded string '$decoded' should actually be '$original'" }.toBe(original) + assertEquals(original, decoded, "Decoded string '$decoded' should actually be '$original'") } } diff --git a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/util/FinTsUtilsTest.kt b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/util/FinTsUtilsTest.kt index 18278551..d7958093 100644 --- a/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/util/FinTsUtilsTest.kt +++ b/fints4k/src/commonTest/kotlin/net/dankito/banking/fints/util/FinTsUtilsTest.kt @@ -1,11 +1,10 @@ package net.dankito.banking.fints.util -import ch.tutteli.atrium.api.fluent.en_GB.toBe -import ch.tutteli.atrium.api.verbs.expect import kotlinx.datetime.LocalDate import kotlinx.datetime.LocalDateTime import net.dankito.utils.multiplatform.extensions.of import kotlin.test.Test +import kotlin.test.assertEquals class FinTsUtilsTest { @@ -22,7 +21,7 @@ class FinTsUtilsTest { val result = underTest.formatDate(date) // then - expect(result).toBe("19880327") + assertEquals("19880327", result) } @Test @@ -35,7 +34,7 @@ class FinTsUtilsTest { val result = underTest.formatDateAsInt(date) // then - expect(result).toBe(19880327) + assertEquals(19880327, result) } @@ -49,7 +48,7 @@ class FinTsUtilsTest { val result = underTest.formatTime(time) // then - expect(result).toBe("080201") + assertEquals("080201", result) } @Test @@ -62,7 +61,7 @@ class FinTsUtilsTest { val result = underTest.formatTime(time) // then - expect(result).toBe("182251") + assertEquals("182251", result) } @Test @@ -75,7 +74,7 @@ class FinTsUtilsTest { val result = underTest.formatTimeAsInt(time) // then - expect(result).toBe(80201) + assertEquals(80201, result) } @Test @@ -88,7 +87,7 @@ class FinTsUtilsTest { val result = underTest.formatTimeAsInt(time) // then - expect(result).toBe(182251) + assertEquals(182251, result) } } \ No newline at end of file diff --git a/fints4k/src/jvmTest/kotlin/net/dankito/banking/fints/FinTsClientTestBase.kt b/fints4k/src/jvmTest/kotlin/net/dankito/banking/fints/FinTsClientTestBase.kt index 90b08afd..224f592d 100644 --- a/fints4k/src/jvmTest/kotlin/net/dankito/banking/fints/FinTsClientTestBase.kt +++ b/fints4k/src/jvmTest/kotlin/net/dankito/banking/fints/FinTsClientTestBase.kt @@ -88,7 +88,7 @@ // underTest.getAnonymousBankInfo(BankDataAnonymous) { result -> // // // then -// expect(result.successful).isTrue() +// assertTrue(result.successful) // expect(BankDataAnonymous.supportedHbciVersions).isNotEmpty() // expect(BankDataAnonymous.tanMethodsSupportedByBank).isNotEmpty() // expect(BankDataAnonymous.supportedJobs).isNotEmpty() @@ -117,9 +117,9 @@ // countDownLatch.await(30, TimeUnit.SECONDS) // val result = response.get() // -// expect(result.successful).isTrue() +// assertTrue(result.successful) // -// expect(didAskUserForTanMethod).isFalse() +// assertFalse(didAskUserForTanMethod) // // expect(Bank.bankName).isNotEmpty() // expect(Bank.supportedJobs).isNotEmpty() // supported jobs are now known @@ -131,7 +131,7 @@ // expect(Bank.tanMethodsAvailableForUser).isNotEmpty() // expect(Bank.selectedLanguage).notToBe(Dialogsprache.Default) // language is set now // expect(Bank.customerSystemId).notToBe(KundensystemStatus.SynchronizingCustomerSystemId.code) // customer system id is now set -// expect(Bank.customerSystemStatus).toBe(KundensystemStatusWerte.Benoetigt) // customerSystemStatus is set now +// assertEquals(KundensystemStatusWerte.Benoetigt, Bank.customerSystemStatus) // customerSystemStatus is set now // expect(Bank.accounts).isNotEmpty() // accounts are now known // expect(Bank.accounts.first().allowedJobs).isNotEmpty() // allowed jobs are now known // } @@ -205,7 +205,7 @@ // countDownLatch.await(30, TimeUnit.SECONDS) // val result = response.get() // -// expect(result.successful).isTrue() +// assertTrue(result.successful) // // expect(result.tanMediaList).notToBeNull() // expect(result.tanMediaList!!.usageOption).toBe(TanEinsatzOption.KundeKannGenauEinMediumZuEinerZeitNutzen) // TODO: may adjust to your value @@ -263,7 +263,7 @@ // countDownLatch.await(30, TimeUnit.SECONDS) // val result = response.get() // -// expect(result.successful).isTrue() +// assertTrue(result.successful) // // } // diff --git a/multiplatform-utils/build.gradle b/multiplatform-utils/build.gradle index d0baede8..6e668fa7 100644 --- a/multiplatform-utils/build.gradle +++ b/multiplatform-utils/build.gradle @@ -54,8 +54,6 @@ kotlin { dependencies { implementation kotlin("test-common") implementation kotlin("test-annotations-common") - - implementation "ch.tutteli.atrium:atrium-fluent-en_GB-common:$atriumVersion" } } @@ -76,11 +74,6 @@ kotlin { implementation "org.junit.jupiter:junit-jupiter:$junit5Version" runtimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit5Version" - implementation "org.assertj:assertj-core:$assertJVersion" - implementation "org.mockito:mockito-core:$mockitoVersion" - - implementation "ch.tutteli.atrium:atrium-fluent-en_GB:$atriumVersion" - implementation "org.slf4j:slf4j-simple:$slf4jVersion" } diff --git a/tools/BankListCreator/build.gradle b/tools/BankListCreator/build.gradle index d90eb9ae..cc3c8db7 100644 --- a/tools/BankListCreator/build.gradle +++ b/tools/BankListCreator/build.gradle @@ -21,7 +21,7 @@ dependencies { implementation 'org.docx4j:docx4j-JAXB-ReferenceImpl:8.1.3' - testImplementation "junit:junit:$junitVersion" + testImplementation "junit:junit:4.12" testImplementation "org.assertj:assertj-core:$assertJVersion" testImplementation "ch.qos.logback:logback-core:$logbackVersion"