### Question:
ConsentModelMapper { public ConsentInformationResponse200Json mapToConsentInformationResponse200Json(AisConsent aisConsent) { return Optional.ofNullable(aisConsent) .map(consent -> new ConsentInformationResponse200Json() .access(mapToAccountAccessDomain(consent)) .recurringIndicator(consent.isRecurringIndicator()) .validUntil(consent.getValidUntil()) .frequencyPerDay(consent.getFrequencyPerDay()) .lastActionDate(consent.getLastActionDate()) .consentStatus(ConsentStatus.fromValue(consent.getConsentStatus().getValue())) ) .orElse(null); }  CreateConsentReq mapToCreateConsentReq(Consents consent, TppRedirectUri tppRedirectUri,
                                                  TppNotificationData tppNotificationData, String tppBrandLoggingInformation,
                                                  String instanceId); ConsentStatusResponse200 mapToConsentStatusResponse200(ConsentStatusResponse consentStatusResponse); ConsentsResponse201 mapToConsentsResponse201(CreateConsentResponse createConsentResponse); ConsentInformationResponse200Json mapToConsentInformationResponse200Json(AisConsent aisConsent); List<AccountReference> mapToXs2aAccountReferences(List<de.adorsys.psd2.model.AccountReference> references); AccountReference mapToAccountReference(Object reference); UpdateConsentPsuDataReq mapToUpdatePsuData(PsuIdData psuData, String consentId, String authorizationId, Map body); Authorisations mapToAuthorisations(Xs2aPaymentCancellationAuthorisationSubResource idsContainer); Xs2aUpdatePisCommonPaymentPsuDataRequest mapToPisUpdatePsuData(PsuIdData psuData, String paymentId, String authorisationId, PaymentType paymentService, String paymentProduct, Map body); final AccountModelMapper accountModelMapper; }### Answer:
@Test void mapToConsentInformationResponse200Json_WithCorrectInput() { AisConsent accountConsent = getAisConsent(); ConsentInformationResponse200Json expected = jsonReader.getObjectFromFile("json/service/mapper/consent-information-response-200-json.json", ConsentInformationResponse200Json.class); de.adorsys.psd2.model.AccountReference accountReference = jsonReader.getObjectFromFile("json/service/mapper/account-reference.json", de.adorsys.psd2.model.AccountReference.class); when(accountModelMapper.mapToAccountReferences(accountConsent.getAccess().getAccounts())) .thenReturn(Collections.singletonList(accountReference)); ConsentInformationResponse200Json actual = consentModelMapper.mapToConsentInformationResponse200Json(accountConsent); assertEquals(expected, actual); }
@Test void mapToConsentInformationResponse200Json_WithNull() { ConsentInformationResponse200Json actual = consentModelMapper.mapToConsentInformationResponse200Json(null); assertNull(actual); }