### Question:
CmsCommonPaymentMapperSupportImpl implements CmsCommonPaymentMapper { @Override public CmsPayment mapToCmsPeriodicPayment(CmsCommonPayment cmsCommonPayment) { PeriodicPaymentInitiationJson payment = convert(cmsCommonPayment.getPaymentData(), PeriodicPaymentInitiationJson.class); if (payment == null) { return null; } return mapToCmsPeriodicPayment(payment, cmsCommonPayment); }  @Override CmsPayment mapToCmsSinglePayment(CmsCommonPayment cmsCommonPayment); @Override CmsPayment mapToCmsBulkPayment(CmsCommonPayment cmsCommonPayment); @Override CmsPayment mapToCmsPeriodicPayment(CmsCommonPayment cmsCommonPayment);  }### Answer:
@Test void mapToCmsPeriodicPayment() throws JsonProcessingException { PeriodicPaymentInitiationJson paymentInitiationJson = jsonReader.getObjectFromFile("json/periodic-payment-initiation-resp.json", PeriodicPaymentInitiationJson.class); cmsCommonPayment.setPaymentData(xs2aObjectMapper.writeValueAsBytes(paymentInitiationJson)); CmsPayment actual = mapper.mapToCmsPeriodicPayment(cmsCommonPayment); CmsPeriodicPayment expected = getCmsPeriodicPayment(paymentInitiationJson); assertEquals(expected, actual); }
@Test void mapToCmsPeriodicPayment_payDataIsNull() { cmsCommonPayment.setPaymentData(null); assertNull(mapper.mapToCmsPeriodicPayment(cmsCommonPayment)); }
@Test void mapToCmsPeriodicPayment_remittanceIsNull() throws JsonProcessingException { PeriodicPaymentInitiationJson paymentInitiationJson = jsonReader.getObjectFromFile("json/periodic-payment-initiation-resp.json", PeriodicPaymentInitiationJson.class); paymentInitiationJson.setRemittanceInformationStructured(null); cmsCommonPayment.setPaymentData(xs2aObjectMapper.writeValueAsBytes(paymentInitiationJson)); CmsPayment actual = mapper.mapToCmsPeriodicPayment(cmsCommonPayment); CmsPeriodicPayment expected = getCmsPeriodicPayment(paymentInitiationJson); expected.setRemittanceInformationStructured(null); assertEquals(expected, actual); }