### Question:
CmsConsentMapper { public CmsConsent mapToCmsConsent(ConsentEntity entity, List<AuthorisationEntity> authorisations, Map<String, Integer> usages) { CmsConsent cmsConsent = new CmsConsent(); cmsConsent.setId(entity.getExternalId()); cmsConsent.setConsentData(entity.getData()); cmsConsent.setChecksum(entity.getChecksum()); cmsConsent.setConsentStatus(entity.getConsentStatus()); cmsConsent.setConsentType(ConsentType.getByValue(entity.getConsentType())); cmsConsent.setTppInformation(consentTppInformationMapper.mapToConsentTppInformation(entity.getTppInformation())); cmsConsent.setAuthorisationTemplate(authorisationTemplateMapper.mapToAuthorisationTemplate(entity.getAuthorisationTemplate())); cmsConsent.setInternalRequestId(entity.getInternalRequestId()); cmsConsent.setFrequencyPerDay(entity.getFrequencyPerDay()); cmsConsent.setValidUntil(entity.getValidUntil()); cmsConsent.setPsuIdDataList(psuDataMapper.mapToPsuIdDataList(entity.getPsuDataList())); cmsConsent.setRecurringIndicator(entity.isRecurringIndicator()); cmsConsent.setMultilevelScaRequired(entity.isMultilevelScaRequired()); cmsConsent.setExpireDate(entity.getExpireDate()); cmsConsent.setLastActionDate(entity.getLastActionDate()); cmsConsent.setAuthorisations(authorisationMapper.mapToAuthorisations(authorisations)); cmsConsent.setUsages(usages); cmsConsent.setTppAccountAccesses(accessMapper.mapTppAccessesToAccountAccess(entity.getTppAccountAccesses(), entity.getOwnerNameType(), entity.getTrustedBeneficiariesType())); cmsConsent.setAspspAccountAccesses(accessMapper.mapAspspAccessesToAccountAccess(entity.getAspspAccountAccesses(), entity.getOwnerNameType(), entity.getTrustedBeneficiariesType())); cmsConsent.setInstanceId(entity.getInstanceId()); cmsConsent.setSigningBasketBlocked(entity.isSigningBasketBlocked()); return cmsConsent; }  List<CmsConsent> mapToCmsConsents(List<ConsentEntity> entities, Map<String, List<AuthorisationEntity>> authorisation, Map<String, Map<String, Integer>> usages); CmsConsent mapToCmsConsent(ConsentEntity entity, List<AuthorisationEntity> authorisations, Map<String, Integer> usages); ConsentEntity mapToNewConsentEntity(CmsConsent cmsConsent);  }### Answer:
@Test void mapToCmsConsent() { AuthorisationEntity authorisationEntity = jsonReader.getObjectFromFile("json/service/mapper/cms-consent-mapper/authorisation-entity.json", AuthorisationEntity.class); List<AuthorisationEntity> authorisations = Collections.singletonList(authorisationEntity); ConsentEntity consentEntity = jsonReader.getObjectFromFile("json/service/mapper/cms-consent-mapper/consent-entity.json", ConsentEntity.class); CmsConsent actual = cmsConsentMapper.mapToCmsConsent(consentEntity, authorisations, getUsages()); CmsConsent expected = jsonReader.getObjectFromFile("json/service/mapper/cms-consent-mapper/cms-consent.json", CmsConsent.class); assertEquals(expected, actual); }