### Question:
PisCommonPaymentServiceInternal implements PisCommonPaymentService { @Override @Transactional public CmsResponse<CreatePisCommonPaymentResponse> createCommonPayment(PisPaymentInfo request) { PisCommonPaymentData commonPaymentData = pisCommonPaymentMapper.mapToPisCommonPaymentData(request); tppInfoRepository.findByAuthorisationNumber(request.getTppInfo().getAuthorisationNumber()) .ifPresent(commonPaymentData::setTppInfo); PisCommonPaymentData saved = pisCommonPaymentDataRepository.save(commonPaymentData); if (saved.getId() == null) { log.info("Payment ID: [{}]. Pis common payment cannot be created, because when saving to DB got null PisCommonPaymentData ID", request.getPaymentId()); return CmsResponse.<CreatePisCommonPaymentResponse>builder() .error(TECHNICAL_ERROR) .build(); } return CmsResponse.<CreatePisCommonPaymentResponse>builder() .payload(new CreatePisCommonPaymentResponse(saved.getPaymentId(), saved.getTppNotificationContentPreferred())) .build(); }  @Override @Transactional CmsResponse<CreatePisCommonPaymentResponse> createCommonPayment(PisPaymentInfo request); @Override @Transactional CmsResponse<TransactionStatus> getPisCommonPaymentStatusById(String paymentId); @Override @Transactional CmsResponse<PisCommonPaymentResponse> getCommonPaymentById(String paymentId); @Override @Transactional CmsResponse<Boolean> updateCommonPaymentStatusById(String paymentId, TransactionStatus status); @Override @Transactional CmsResponse<Boolean> updateMultilevelSca(String paymentId, boolean multilevelScaRequired); @Override CmsResponse<List<PsuIdData>> getPsuDataListByPaymentId(String paymentId);  }### Answer:
@Test void createCommonPayment_checkUpdateTppRoles() { List<TppRole> roles = Arrays.asList(TppRole.AISP, TppRole.PISP, TppRole.PIISP); ArgumentCaptor<PisCommonPaymentData> argument = ArgumentCaptor.forClass(PisCommonPaymentData.class); TppInfo tppInfo = new TppInfo(); tppInfo.setAuthorisationNumber("tpp-id-1"); PisPaymentInfo pisPaymentInfo = new PisPaymentInfo(); pisPaymentInfo.setTppInfo(tppInfo); TppInfoEntity tppInfoEntity = new TppInfoEntity(); tppInfoEntity.setTppRoles(roles); PisCommonPaymentData pisCommonPaymentData = new PisCommonPaymentData(); pisCommonPaymentData.setTppInfo(tppInfoEntity); when(pisCommonPaymentMapper.mapToPisCommonPaymentData(pisPaymentInfo)) .thenReturn(pisCommonPaymentData); when(pisCommonPaymentDataRepository.save(pisCommonPaymentData)).thenReturn(pisCommonPaymentData); pisCommonPaymentService.createCommonPayment(pisPaymentInfo); verify(pisCommonPaymentDataRepository).save(argument.capture()); assertEquals(roles, argument.getValue().getTppInfo().getTppRoles()); }