bugfix/compile_stackoverflow: fix compile stackoverflow error, and fix compile warnings.

This commit is contained in:
shuang 2019-10-12 15:08:58 +08:00
parent 20293fdbea
commit 155fccded4
11 changed files with 65 additions and 45 deletions

View File

@ -593,7 +593,7 @@ $additionalInstructions
amountOfMoneyJSON = transDetailsJson.instructedAmount
(createdTransactionRequest,callContext) <- transactionRequestTypes match {
case TransactionRequestTypes.sepa_credit_transfers => {
case TransactionRequestTypes.SEPA_CREDIT_TRANSFERS => {
for {
(createdTransactionRequest, callContext) <- NewStyle.function.createTransactionRequestv210(
u,

View File

@ -393,7 +393,7 @@ object ApiRole {
case class CanGetAnyKycStatuses(requiresBankId: Boolean = false) extends ApiRole
lazy val canGetAnyKycStatuses = CanGetAnyKycStatuses()
private val roles =
private var roles =
canSearchAllTransactions ::
canSearchAllAccounts ::
canQueryOtherUser ::
@ -424,6 +424,9 @@ object ApiRole {
canDeleteEntitlementAtAnyBank ::
canGetConsumers ::
canDisableConsumers ::
Nil
roles ++=
canEnableConsumers ::
canUpdateConsumerRedirectUrl ::
canCreateConsumer ::
@ -454,6 +457,9 @@ object ApiRole {
canReadAggregateMetrics ::
canCreateScopeAtOneBank ::
canCreateScopeAtAnyBank ::
Nil
roles ++=
canDeleteScopeAtAnyBank ::
canDeleteScopeAtOneBank ::
canUnlockUser ::
@ -484,6 +490,9 @@ object ApiRole {
canDeleteBranch ::
canCreateSystemView ::
canUpdateSystemView ::
Nil
roles ++=
canGetSystemView ::
canDeleteSystemView ::
canCreateUserAuthContextUpdate ::

View File

@ -29,10 +29,9 @@ object X509 {
// Parsing failed
Nil
} else {
cert.getSubjectDN().getName().split(",").toList.map {
attribute => attribute.trim.split("=").toList match {
case key :: value :: Nil => SubjectAttribute(key, value)
}
cert.getSubjectDN().getName().split(",").toList.map { attribute =>
val Array(key, value) = attribute.trim.split("=")
SubjectAttribute(key, value)
}
}
}
@ -94,8 +93,7 @@ object X509 {
Full(getPsd2Roles(asn1encodable: Array[ASN1Encodable]))
}
catch {
case _ =>
Failure(ErrorMessages.X509ThereAreNoPsd2Roles)
case _: Throwable => Failure(ErrorMessages.X509ThereAreNoPsd2Roles)
}
}
}

View File

@ -25,7 +25,7 @@ object TableViewDefinition {
for {
view: ViewImpl <- views
} yield {
ViewDefinition
val viewDefinition = ViewDefinition
.create
.isSystem_(view.isSystem)
.isFirehose_(view.isFirehose)
@ -56,6 +56,8 @@ object TableViewDefinition {
.canSeeBankAccountType_(view.canSeeBankAccountType)
.canSeeBankAccountBalance_(view.canSeeBankAccountBalance)
.canSeeBankAccountCurrency_(view.canSeeBankAccountCurrency)
viewDefinition
.canSeeBankAccountLabel_(view.canSeeBankAccountLabel)
.canSeeBankAccountNationalIdentifier_(view.canSeeBankAccountNationalIdentifier)
.canSeeBankAccountSwift_bic_(view.canSeeBankAccountSwift_bic)
@ -86,6 +88,8 @@ object TableViewDefinition {
.canAddPhysicalLocation_(view.canAddPhysicalLocation)
.canAddPublicAlias_(view.canAddPublicAlias)
.canAddPrivateAlias_(view.canAddPrivateAlias)
viewDefinition
.canAddCounterparty_(view.canAddCounterparty)
.canDeleteCorporateLocation_(view.canDeleteCorporateLocation)
.canDeletePhysicalLocation_(view.canDeletePhysicalLocation)

View File

@ -276,7 +276,7 @@ object OBPAPI3_1_0 extends OBPRestHelper with APIMethods130 with APIMethods140 w
val endpointsOfCustom3_0_0 = ImplementationsCustom3_0_0.endpointsOfCustom3_0_0
// Possible Endpoints from 3.1.0
val endpointsOf3_1_0 = Implementations3_1_0.getCheckbookOrders ::
var endpointsOf3_1_0 = Implementations3_1_0.getCheckbookOrders ::
Implementations3_1_0.getStatusOfCreditCardOrder ::
Implementations3_1_0.createCreditLimitRequest ::
Implementations3_1_0.getCreditLimitRequests ::
@ -316,7 +316,9 @@ object OBPAPI3_1_0 extends OBPRestHelper with APIMethods130 with APIMethods140 w
Implementations3_1_0.deleteCustomerAddress ::
Implementations3_1_0.getObpApiLoopback ::
Implementations3_1_0.refreshUser ::
Implementations3_1_0.createProductAttribute ::
Nil
endpointsOf3_1_0 ++= Implementations3_1_0.createProductAttribute ::
Implementations3_1_0.getProductAttribute ::
Implementations3_1_0.updateProductAttribute ::
Implementations3_1_0.deleteProductAttribute ::
@ -355,8 +357,10 @@ object OBPAPI3_1_0 extends OBPRestHelper with APIMethods130 with APIMethods140 w
Implementations3_1_0.updateAccount ::
Implementations3_1_0.addCardForBank ::
Implementations3_1_0.deleteCardForBank ::
Implementations3_1_0.getCardForBank ::
Implementations3_1_0.getCardsForBank ::
Implementations3_1_0.getCardForBank ::
Nil
endpointsOf3_1_0 ++= Implementations3_1_0.getCardsForBank ::
Implementations3_1_0.updatedCardForBank ::
Implementations3_1_0.updateCustomerIdentity ::
Implementations3_1_0.updateCustomerBranch ::

View File

@ -277,7 +277,7 @@ object OBPAPI4_0_0 extends OBPRestHelper with APIMethods130 with APIMethods140 w
val endpointsOfCustom3_0_0 = ImplementationsCustom3_0_0.endpointsOfCustom3_0_0
// Possible Endpoints from 3.1.0
val endpointsOf3_1_0 = Implementations3_1_0.getCheckbookOrders ::
var endpointsOf3_1_0 = Implementations3_1_0.getCheckbookOrders ::
Implementations3_1_0.getStatusOfCreditCardOrder ::
Implementations3_1_0.createCreditLimitRequest ::
Implementations3_1_0.getCreditLimitRequests ::
@ -317,7 +317,9 @@ object OBPAPI4_0_0 extends OBPRestHelper with APIMethods130 with APIMethods140 w
Implementations3_1_0.deleteCustomerAddress ::
Implementations3_1_0.getObpApiLoopback ::
Implementations3_1_0.refreshUser ::
Implementations3_1_0.createProductAttribute ::
Nil
endpointsOf3_1_0 ++= Implementations3_1_0.createProductAttribute ::
Implementations3_1_0.getProductAttribute ::
Implementations3_1_0.updateProductAttribute ::
Implementations3_1_0.deleteProductAttribute ::
@ -356,8 +358,10 @@ object OBPAPI4_0_0 extends OBPRestHelper with APIMethods130 with APIMethods140 w
Implementations3_1_0.updateAccount ::
Implementations3_1_0.addCardForBank ::
Implementations3_1_0.deleteCardForBank ::
Implementations3_1_0.getCardForBank ::
Implementations3_1_0.getCardsForBank ::
Implementations3_1_0.getCardForBank ::
Nil
endpointsOf3_1_0 ++= Implementations3_1_0.getCardsForBank ::
Implementations3_1_0.updatedCardForBank ::
Implementations3_1_0.updateCustomerIdentity ::
Implementations3_1_0.updateCustomerBranch ::

View File

@ -1091,7 +1091,7 @@ trait Connector extends MdcLoggable with CustomJsonFormats{
}yield{
(transactionId,callContext)
}
case sepa_credit_transfers => for{
case SEPA_CREDIT_TRANSFERS => for{
toSepaCreditTransfers <- NewStyle.function.tryons(s"$TransactionRequestDetailsExtractException It can not extract to $TransactionRequestBodySandBoxTanJSON ", 400, callContext){
body.to_sepa_credit_transfers.get

View File

@ -276,7 +276,7 @@ class MappedTransactionRequest extends LongKeyedMapper[MappedTransactionRequest]
else
None
//This is Berlin Group Types:
val t_to_sepa_credit_transfers = if (TransactionRequestTypes.withName(transactionType) == TransactionRequestTypes.sepa_credit_transfers && details.nonEmpty)
val t_to_sepa_credit_transfers = if (TransactionRequestTypes.withName(transactionType) == TransactionRequestTypes.SEPA_CREDIT_TRANSFERS && details.nonEmpty)
Some(parsedDetails.extract[SepaCreditTransfers]) //TODO, here may need a internal case class, but for now, we used it from request json body.
else
None

View File

@ -29,7 +29,7 @@ object TransactionRequests extends SimpleInjector {
type TransactionRequestTypes = Value
val SANDBOX_TAN, ACCOUNT, ACCOUNT_OTP, COUNTERPARTY, SEPA, FREE_FORM, TRANSFER_TO_PHONE, TRANSFER_TO_ATM, TRANSFER_TO_ACCOUNT, TRANSFER_TO_REFERENCE_ACCOUNT,
//The following are BerlinGroup Standard
sepa_credit_transfers, instant_sepa_credit_transfers, target_2_payments, cross_border_credit_transfers= Value
SEPA_CREDIT_TRANSFERS, INSTANT_SEPA_CREDIT_TRANSFERS, TARGET_2_PAYMENTS, CROSS_BORDER_CREDIT_TRANSFERS= Value
}
def updatestatus(newStatus: String) = {}

View File

@ -48,7 +48,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
|"creditorName": "70charname"
}""".stripMargin
val requestPost = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.sepa_credit_transfers.toString).POST <@ (user1)
val requestPost = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString).POST <@ (user1)
val response: APIResponse = makePostRequest(requestPost, wrongInitiatePaymentJson)
Then("We should get a 400 ")
response.code should equal(400)
@ -72,7 +72,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
|"creditorName": "70charname"
}""".stripMargin
val requestPost = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.sepa_credit_transfers.toString).POST <@ (user1)
val requestPost = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString).POST <@ (user1)
val response: APIResponse = makePostRequest(requestPost, wrongAmountInitiatePaymentJson)
Then("We should get a 400 ")
response.code should equal(400)
@ -103,7 +103,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
|"creditorName": "70charname"
}""".stripMargin
val requestPost = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.sepa_credit_transfers.toString).POST <@ (user1)
val requestPost = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString).POST <@ (user1)
val response: APIResponse = makePostRequest(requestPost, initiatePaymentJson)
Then("We should get a 201 ")
response.code should equal(201)
@ -142,7 +142,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
|"creditorName": "70charname"
}""".stripMargin
val requestPost = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.sepa_credit_transfers.toString).POST <@ (user1)
val requestPost = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString).POST <@ (user1)
val response: APIResponse = makePostRequest(requestPost, initiatePaymentJson)
Then("We should get a 201 ")
response.code should equal(201)
@ -180,7 +180,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
|"creditorName": "70charname"
}""".stripMargin
val requestPost = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.sepa_credit_transfers.toString).POST <@ (user1)
val requestPost = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString).POST <@ (user1)
val response: APIResponse = makePostRequest(requestPost, initiatePaymentJson)
Then("We should get a 201 ")
response.code should equal(201)
@ -190,7 +190,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
Then(s"we test the ${getPaymentInformation.name}")
val paymentId = payment.paymentId
val requestGet = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.sepa_credit_transfers.toString / paymentId).GET <@ (user1)
val requestGet = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString / paymentId).GET <@ (user1)
val responseGet: APIResponse = makeGetRequest(requestGet)
responseGet.code should be (200)
responseGet.body.extract[SepaCreditTransfers].instructedAmount.currency should be ("EUR")
@ -222,7 +222,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
|"creditorName": "70charname"
}""".stripMargin
val requestPost = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.sepa_credit_transfers.toString).POST <@ (user1)
val requestPost = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString).POST <@ (user1)
val response: APIResponse = makePostRequest(requestPost, initiatePaymentJson)
Then("We should get a 201 ")
response.code should equal(201)
@ -233,7 +233,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
Then(s"we test the ${getPaymentInitiationStatus.name}")
val paymentId = payment.paymentId
val requestGet = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.sepa_credit_transfers.toString / paymentId / "status").GET <@ (user1)
val requestGet = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString / paymentId / "status").GET <@ (user1)
val responseGet: APIResponse = makeGetRequest(requestGet)
responseGet.code should be (200)
(responseGet.body \ "transactionStatus").extract[String] should be ("RCVD")
@ -243,7 +243,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
feature(s"test the BG v1.3 ${startPaymentAuthorisation.name} and ${getPaymentInitiationAuthorisation.name} and ${getPaymentInitiationScaStatus.name} and ${updatePaymentPsuData.name}") {
scenario(s"${startPaymentAuthorisation.name} Failed Case - Wrong PaymentId", BerlinGroupV1_3, PIS, startPaymentAuthorisation) {
val requestPost = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.sepa_credit_transfers.toString / "PAYMENT_ID" / "authorisations").POST <@ (user1)
val requestPost = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString / "PAYMENT_ID" / "authorisations").POST <@ (user1)
val response: APIResponse = makePostRequest(requestPost, """""")
Then("We should get a 400 ")
response.code should equal(400)
@ -274,7 +274,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
|"creditorName": "70charname"
}""".stripMargin
val requestInitiatePaymentJson = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.sepa_credit_transfers.toString).POST <@ (user1)
val requestInitiatePaymentJson = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString).POST <@ (user1)
val responseInitiatePaymentJson: APIResponse = makePostRequest(requestInitiatePaymentJson, initiatePaymentJson)
Then("We should get a 201 ")
responseInitiatePaymentJson.code should equal(201)
@ -285,7 +285,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
val paymentId = paymentResponseInitiatePaymentJson.paymentId
Then(s"we test the ${startPaymentAuthorisation.name}")
val requestPost = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.sepa_credit_transfers.toString / paymentId / "authorisations").POST <@ (user1)
val requestPost = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString / paymentId / "authorisations").POST <@ (user1)
val response: APIResponse = makePostRequest(requestPost, """""")
Then("We should get a 200 ")
response.code should equal(200)
@ -297,7 +297,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
startPaymentAuthorisationResponse._links.scaStatus should not be null
Then(s"We can test the ${getPaymentInitiationAuthorisation.name}")
val requestGetPaymentInitiationAuthorisation = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.sepa_credit_transfers.toString / paymentId / "authorisations").GET <@ (user1)
val requestGetPaymentInitiationAuthorisation = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString / paymentId / "authorisations").GET <@ (user1)
val responseGetPaymentInitiationAuthorisation: APIResponse = makeGetRequest(requestGetPaymentInitiationAuthorisation)
responseGetPaymentInitiationAuthorisation.code should be (200)
responseGetPaymentInitiationAuthorisation.body.extract[List[StartPaymentAuthorisationJson]].length > 0 should be (true)
@ -306,7 +306,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
paymentInitiationAuthorisation.scaStatus should be (ScaStatus.received.toString)
Then(s"We can test the ${getPaymentInitiationScaStatus.name}")
val requestGetPaymentInitiationScaStatus = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.sepa_credit_transfers.toString / paymentId / "authorisations" /authorisationId).GET <@ (user1)
val requestGetPaymentInitiationScaStatus = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString / paymentId / "authorisations" /authorisationId).GET <@ (user1)
val responseGetPaymentInitiationScaStatus: APIResponse = makeGetRequest(requestGetPaymentInitiationScaStatus)
responseGetPaymentInitiationScaStatus.code should be (200)
val paymentInitiationScaStatus = (responseGetPaymentInitiationScaStatus.body \ "scaStatus").extract[String]
@ -319,7 +319,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
.head.exampleRequestBody.asInstanceOf[JvalueCaseClass] //All the Json String convert to JvalueCaseClass implicitly
.jvalueToCaseclass
val requestUpdatePaymentPsuData = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.sepa_credit_transfers.toString / paymentId / "authorisations"/authorisationId).PUT <@ (user1)
val requestUpdatePaymentPsuData = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString / paymentId / "authorisations"/authorisationId).PUT <@ (user1)
val responseUpdatePaymentPsuData: APIResponse = makePutRequest(requestUpdatePaymentPsuData, write(updatePaymentPsuDataJsonBody))
responseUpdatePaymentPsuData.code should be (200)
responseUpdatePaymentPsuData.body.extract[StartPaymentAuthorisationJson].scaStatus should be("finalised")
@ -340,7 +340,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
s"and ${updatePaymentCancellationPsuData.name}") {
scenario(s"${startPaymentInitiationCancellationAuthorisation.name} Failed Case - Wrong PaymentId", BerlinGroupV1_3, PIS, startPaymentInitiationCancellationAuthorisation) {
val requestPost = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.sepa_credit_transfers.toString / "PAYMENT_ID" / "cancellation-authorisations").POST <@ (user1)
val requestPost = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString / "PAYMENT_ID" / "cancellation-authorisations").POST <@ (user1)
val response: APIResponse = makePostRequest(requestPost, """""")
Then("We should get a 400 ")
response.code should equal(400)
@ -367,7 +367,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
|"creditorName": "70charname"
}""".stripMargin
val requestInitiatePaymentJson = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.sepa_credit_transfers.toString).POST <@ (user1)
val requestInitiatePaymentJson = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString).POST <@ (user1)
val responseInitiatePaymentJson: APIResponse = makePostRequest(requestInitiatePaymentJson, initiatePaymentJson)
Then("We should get a 201 ")
responseInitiatePaymentJson.code should equal(201)
@ -377,7 +377,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
val paymentId = paymentResponseInitiatePaymentJson.paymentId
Then(s"we test the ${startPaymentInitiationCancellationAuthorisation.name}")
val requestPost = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.sepa_credit_transfers.toString / paymentId / "cancellation-authorisations").POST <@ (user1)
val requestPost = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString / paymentId / "cancellation-authorisations").POST <@ (user1)
val response: APIResponse = makePostRequest(requestPost)
Then("We should get a 200 ")
response.code should equal(200)
@ -389,7 +389,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
startPaymentAuthorisationResponse._links.scaStatus should not be null
Then(s"We can test the ${getPaymentInitiationCancellationAuthorisationInformation.name}")
val requestGetPaymentInitiationCancellationAuthorisationInformation = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.sepa_credit_transfers.toString / paymentId / "cancellation-authorisations").GET <@ (user1)
val requestGetPaymentInitiationCancellationAuthorisationInformation = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString / paymentId / "cancellation-authorisations").GET <@ (user1)
val responseGetPaymentInitiationCancellationAuthorisationInformation: APIResponse = makeGetRequest(requestGetPaymentInitiationCancellationAuthorisationInformation)
responseGetPaymentInitiationCancellationAuthorisationInformation.code should be (200)
responseGetPaymentInitiationCancellationAuthorisationInformation.body.extract[CancellationJsonV13].cancellationIds.length > 0 should be (true)
@ -397,7 +397,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
val cancelationId = cancellationJsonV13.head
Then(s"We can test the ${getPaymentCancellationScaStatus.name}")
val requestGetPaymentCancellationScaStatus = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.sepa_credit_transfers.toString / paymentId / "cancellation-authorisations" /cancelationId).GET <@ (user1)
val requestGetPaymentCancellationScaStatus = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString / paymentId / "cancellation-authorisations" /cancelationId).GET <@ (user1)
val responseGetPaymentCancellationScaStatus: APIResponse = makeGetRequest(requestGetPaymentCancellationScaStatus)
responseGetPaymentCancellationScaStatus.code should be (200)
val cancellationScaStatus = (responseGetPaymentCancellationScaStatus.body \ "scaStatus").extract[String]
@ -410,7 +410,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
.head.exampleRequestBody.asInstanceOf[JvalueCaseClass] //All the Json String convert to JvalueCaseClass implicitly
.jvalueToCaseclass
val requestUpdatePaymentCancellationPsuData = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.sepa_credit_transfers.toString / paymentId / "cancellation-authorisations"/cancelationId).PUT <@ (user1)
val requestUpdatePaymentCancellationPsuData = (V1_3_BG / PaymentServiceTypes.payments.toString / TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString / paymentId / "cancellation-authorisations"/cancelationId).PUT <@ (user1)
val responseUpdatePaymentCancellationPsuData: APIResponse = makePutRequest(requestUpdatePaymentCancellationPsuData, write(updatePaymentCancellationPsuDataJsonBody))
responseUpdatePaymentCancellationPsuData.code should be (200)
responseUpdatePaymentCancellationPsuData.body.extract[StartPaymentAuthorisationJson].scaStatus should be("finalised")
@ -425,7 +425,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
val cancellationId = "NON_EXISTING_CANCELLATION_ID"
val requestGet = (V1_3_BG /
PaymentServiceTypes.bulk_payments.toString /
TransactionRequestTypes.sepa_credit_transfers.toString /
TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString /
"PAYMENT_ID" /
"cancellation-authorisations" /
cancellationId).POST <@ (user1)
@ -442,7 +442,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
When("Post empty to call initiatePayment")
val requestGet = (V1_3_BG /
PaymentServiceTypes.bulk_payments.toString /
TransactionRequestTypes.sepa_credit_transfers.toString /
TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString /
"NON_EXISTING_PAYMENT_ID" /
"authorisations").POST <@ (user1)
val response: APIResponse = makeGetRequest(requestGet)
@ -458,7 +458,7 @@ class PaymentInitiationServicePISApiTest extends BerlinGroupServerSetupV1_3 with
When("Post empty to call initiatePayment")
val requestGet = (V1_3_BG /
PaymentServiceTypes.bulk_payments.toString /
TransactionRequestTypes.sepa_credit_transfers.toString /
TransactionRequestTypes.SEPA_CREDIT_TRANSFERS.toString /
"NON_EXISTING_PAYMENT_ID" /
"cancellation-authorisations").POST <@ (user1)
val response: APIResponse = makeGetRequest(requestGet)

View File

@ -100,12 +100,13 @@ class OBPEnumerationTest extends FlatSpec with Matchers {
}
}
it should "have compile warnings when match case is not exhaustive with enumeration" taggedAs(OBPEnumTag) in {
// to see the compile warning, just uncomment the follow lines test
/*it should "have compile warnings when match case is not exhaustive with enumeration" taggedAs(OBPEnumTag) in {
val shape: OBPShape = OBPShape.Other
shape match {
case OBPShape.Other => "hi other"
}
}
}*/
"shape.isInstanceOf[OBPColor] " should "return false" taggedAs(OBPEnumTag) in {
// the worst: confused type check