From fee2bfd7000c16e89c89664886a7b23f6f88fb60 Mon Sep 17 00:00:00 2001 From: hongwei Date: Mon, 21 Jun 2021 12:52:58 +0200 Subject: [PATCH] bugfix/added the bankId checking for the bank creation --- .../scala/code/setup/LocalMappedConnectorTestSetup.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/obp-api/src/test/scala/code/setup/LocalMappedConnectorTestSetup.scala b/obp-api/src/test/scala/code/setup/LocalMappedConnectorTestSetup.scala index ab9834d58..7ab810f18 100644 --- a/obp-api/src/test/scala/code/setup/LocalMappedConnectorTestSetup.scala +++ b/obp-api/src/test/scala/code/setup/LocalMappedConnectorTestSetup.scala @@ -26,6 +26,9 @@ trait LocalMappedConnectorTestSetup extends TestConnectorSetupWithStandardPermis // (same in LocalRecordConnectorTestSetup) // Tests should simply use the currently selected connector override protected def createBank(id : String) : Bank = { + //Note: we do not have the `UniqueIndex` for bank.id(permalink) yet, we but when we have getBankById endpoint, + //Better set only create one bank for one id. + MappedBank.findByBankId(BankId(id)).getOrElse( MappedBank.create .fullBankName(randomString(5)) .shortBankName(randomString(5)) @@ -33,7 +36,7 @@ trait LocalMappedConnectorTestSetup extends TestConnectorSetupWithStandardPermis .national_identifier(randomString(5)) .mBankRoutingScheme(randomString(5)) .mBankRoutingAddress(randomString(5)) - .saveMe + .saveMe) } override protected def createCounterparty(bankId: String, accountId: String, counterpartyObpRoutingAddress: String, isBeneficiary: Boolean, createdByUserId:String): CounterpartyTrait = {