@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)); }
@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); }
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); } }
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); }  }
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); }
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);  }