### Question:
CmsCommonPaymentMapperSupportImpl implements CmsCommonPaymentMapper { @Override public CmsPayment mapToCmsSinglePayment(CmsCommonPayment cmsCommonPayment) { PaymentInitiationJson payment = convert(cmsCommonPayment.getPaymentData(), PaymentInitiationJson.class); if (payment == null) { return null; } return mapToCmsSinglePayment(payment, cmsCommonPayment); }  @Override CmsPayment mapToCmsSinglePayment(CmsCommonPayment cmsCommonPayment); @Override CmsPayment mapToCmsBulkPayment(CmsCommonPayment cmsCommonPayment); @Override CmsPayment mapToCmsPeriodicPayment(CmsCommonPayment cmsCommonPayment);  }### Answer:
@Test void mapToCmsSinglePayment() throws JsonProcessingException { PaymentInitiationJson paymentInitiationJson = jsonReader.getObjectFromFile("json/payment-initiation-resp.json", PaymentInitiationJson.class); cmsCommonPayment.setPaymentData(xs2aObjectMapper.writeValueAsBytes(paymentInitiationJson)); CmsPayment actual = mapper.mapToCmsSinglePayment(cmsCommonPayment); CmsSinglePayment expected = getCmsSinglePayment(paymentInitiationJson, cmsCommonPayment); assertEquals(expected, actual); }
@Test void mapToCmsSinglePayment_payDataIsNull() { cmsCommonPayment.setPaymentData(null); assertNull(mapper.mapToCmsSinglePayment(cmsCommonPayment)); }
@Test void mapToCmsSinglePayment_noRemittanceInformationStructuredArray() throws JsonProcessingException { PaymentInitiationJson paymentInitiationJson = jsonReader.getObjectFromFile("json/payment-initiation-resp.json", PaymentInitiationJson.class); paymentInitiationJson.setRemittanceInformationStructuredArray(null); cmsCommonPayment.setPaymentData(xs2aObjectMapper.writeValueAsBytes(paymentInitiationJson)); CmsPayment actual = mapper.mapToCmsSinglePayment(cmsCommonPayment); assertTrue(actual instanceof CmsSinglePayment); CmsSinglePayment actualSinglePayment = (CmsSinglePayment) actual; assertEquals(Collections.emptyList(), actualSinglePayment.getRemittanceInformationStructuredArray()); }