### Question:
PisPsuDataService { public List<PsuIdData> getPsuDataByPaymentId(String paymentId) { CmsResponse<List<PsuIdData>> cmsResponse = pisCommonPaymentServiceEncrypted.getPsuDataListByPaymentId(paymentId); if (cmsResponse.hasError()) { log.info("Payment-ID [{}]. Can't get PsuData by payment ID because PsuData list not found by id at cms.", paymentId); return Collections.emptyList(); } return cmsResponse.getPayload(); }  List<PsuIdData> getPsuDataByPaymentId(String paymentId);  }### Answer:
@Test void getPsuDataByPaymentId_success() { when(pisCommonPaymentServiceEncrypted.getPsuDataListByPaymentId(PAYMENT_ID)) .thenReturn(CmsResponse.<List<PsuIdData>>builder().payload(LIST_PSU_DATA).build()); List<PsuIdData> actualResponse = pisPsuDataService.getPsuDataByPaymentId(PAYMENT_ID); assertThat(actualResponse).isEqualTo(LIST_PSU_DATA); }
@Test void getPsuDataByPaymentId_failed() { when(pisCommonPaymentServiceEncrypted.getPsuDataListByPaymentId(WRONG_ID)) .thenReturn(CmsResponse.<List<PsuIdData>>builder().error(CmsError.TECHNICAL_ERROR).build()); List<PsuIdData> actualResponse = pisPsuDataService.getPsuDataByPaymentId(WRONG_ID); assertThat(actualResponse).isEqualTo(Collections.EMPTY_LIST); }