### Question:
ConsentServiceImpl implements ConsentService { @Override @Transactional public List<String> generateConsents(List<AisConsent> consents) { List<String> consentIds = consents.stream() .map(mapper::mapToCmsConsent) .map(this::doCreateConsent) .filter(Objects::nonNull) .map(CmsResponse::getPayload) .map(CmsCreateConsentResponse::getConsentId) .collect(Collectors.toList()); return updateConsentsStatus(consentIds); }  @Override @Transactional List<String> generateConsents(List<AisConsent> consents);  }### Answer:
@Test void generateConsents() throws WrongChecksumException { when(mapper.mapToCmsConsent(any())).thenReturn(new CmsConsent()); when(consentServiceInternal.createConsent(any())).thenReturn(getCmsResponse()); List<String> result = service.generateConsents(Collections.singletonList(consent())); assertThat(result).isEqualTo(Collections.singletonList(CONSENT_ID)); }