use of com.forgerock.openbanking.common.model.rcs.consentdetails.CustomerInfoConsentDetails in project openbanking-aspsp by OpenBankingToolkit.
the class RCSCustomerInfoDetailsApiTest method shouldReturnCustomerInfoDetails.
@Test
public void shouldReturnCustomerInfoDetails() throws OBErrorException {
FRAccountAccessConsent frAccountAccessConsent = JMockData.mock(FRAccountAccessConsent.class);
frAccountAccessConsent.setConsentId(IntentType.CUSTOMER_INFO_CONSENT.generateIntentId());
FRCustomerInfo customerInfo = JMockData.mock(FRCustomerInfo.class);
given(tppStoreService.findById(frAccountAccessConsent.getAispId())).willReturn(Optional.of(Tpp.builder().clientId(frAccountAccessConsent.getClientId()).build()));
given(accountRequestStoreService.get(any())).willReturn(Optional.ofNullable(frAccountAccessConsent));
given(customerInfoRepository.findByUserID(any())).willReturn(customerInfo);
ResponseEntity<CustomerInfoConsentDetails> response = api.consentDetails("asdfas", Collections.EMPTY_LIST, frAccountAccessConsent.getUserId(), frAccountAccessConsent.getConsentId(), frAccountAccessConsent.getClientId());
CustomerInfoConsentDetails details = response.getBody();
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(details.getCustomerInfo()).isNotNull();
}
Aggregations