use of com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteDomesticConsentData in project openbanking-aspsp by OpenBankingToolkit.
the class RCSConsentDecisionApiControllerIT method getConsentDetailsForSinglePayment.
@Test
public void getConsentDetailsForSinglePayment() throws Exception {
// Given
FRWriteDomesticConsentData writeDomesticConsentData = FRWriteDomesticConsentData.builder().initiation(FRWriteDomesticDataInitiation.builder().build()).build();
FRPaymentSetup payment = FRPaymentSetup.builder().pispId(PISP_ID).pispName(PISP_NAME).status(ConsentStatusCode.AWAITINGAUTHORISATION).paymentSetupRequest(FRWriteDomesticConsent.builder().data(writeDomesticConsentData).build()).build();
payment.getInitiation().setInstructedAmount(FRAmount.builder().build());
when(singlePaymentService.getPayment(any())).thenReturn(payment);
String signedJwtEncoded = toEncodedSignedTestJwt("jwt/singlePaymentConsentRequestPayload.json");
// When
HttpResponse<SinglePaymentConsentDetails> response = Unirest.post("https://rs-rcs:" + port + "/api/rcs/consent/details/").header(OBHeaders.CONTENT_TYPE, CONTENT_TYPE_JWT).header("Cookie", MOCK_COOKIE).body(signedJwtEncoded).asObject(SinglePaymentConsentDetails.class);
// Then
assertThat(response.getStatus()).isEqualTo(200);
SinglePaymentConsentDetails resp = response.getBody();
assertThat(resp.getClientId()).isEqualTo(PISP_ID);
assertThat(resp.getPispName()).isEqualTo(PISP_NAME);
assertThat(resp.getUsername()).isEqualTo(USER_ID);
assertThat(resp.getIntentType()).isEqualTo(IntentType.PAYMENT_SINGLE_REQUEST);
assertThat(resp.getDecisionAPIUri()).isEqualTo(EXPECTED_DECISION_API_URI);
}
use of com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteDomesticConsentData in project openbanking-aspsp by OpenBankingToolkit.
the class RCSConsentDecisionApiControllerIT method getConsentDetailsForDomesticPayment.
@Test
public void getConsentDetailsForDomesticPayment() throws Exception {
// Given
FRWriteDomesticConsentData writeDomesticConsentData = FRWriteDomesticConsentData.builder().initiation(FRWriteDomesticDataInitiation.builder().build()).build();
FRDomesticConsent payment = FRDomesticConsent.builder().pispId(PISP_ID).pispName(PISP_NAME).status(ConsentStatusCode.AWAITINGAUTHORISATION).domesticConsent(FRWriteDomesticConsent.builder().data(writeDomesticConsentData).build()).build();
payment.getInitiation().setInstructedAmount(FRAmount.builder().build());
when(domesticPaymentService.getPayment(any())).thenReturn(payment);
String signedJwtEncoded = toEncodedSignedTestJwt("jwt/domesticPaymentConsentRequestPayload.json");
// When
HttpResponse<DomesticPaymentConsentDetails> response = Unirest.post("https://rs-rcs:" + port + "/api/rcs/consent/details/").header(OBHeaders.CONTENT_TYPE, CONTENT_TYPE_JWT).header("Cookie", MOCK_COOKIE).body(signedJwtEncoded).asObject(DomesticPaymentConsentDetails.class);
// Then
assertThat(response.getStatus()).isEqualTo(200);
DomesticPaymentConsentDetails resp = response.getBody();
assertThat(resp.getClientId()).isEqualTo(PISP_ID);
assertThat(resp.getUsername()).isEqualTo(USER_ID);
assertThat(resp.getIntentType()).isEqualTo(IntentType.PAYMENT_DOMESTIC_CONSENT);
assertThat(resp.getDecisionAPIUri()).isEqualTo(EXPECTED_DECISION_API_URI);
}
Aggregations