### Question:
CmsToXs2aPaymentSupportMapper { public PeriodicPayment mapToPeriodicPayment(CommonPaymentData commonPayment) { if (commonPayment == null) { return null; } byte[] paymentData = commonPayment.getPaymentData(); PeriodicPayment originalPeriodicPayment = rawToXs2aPaymentMapper.mapToPeriodicPayment(paymentData); return enrichWithCommonProperties(originalPeriodicPayment, commonPayment); }  SinglePayment mapToSinglePayment(CommonPaymentData commonPayment); PeriodicPayment mapToPeriodicPayment(CommonPaymentData commonPayment); BulkPayment mapToBulkPayment(CommonPaymentData commonPayment);  }### Answer:
@Test void mapToPeriodicPayment() { PeriodicPayment rawPeriodicPayment = jsonReader.getObjectFromFile("json/support/mapper/raw-xs2a-periodic-payment.json", PeriodicPayment.class); when(rawToXs2aPaymentMapper.mapToPeriodicPayment(PAYMENT_BODY)).thenReturn(rawPeriodicPayment); PeriodicPayment expectedPeriodicPayment = jsonReader.getObjectFromFile("json/support/mapper/enriched-xs2a-periodic-payment.json", PeriodicPayment.class); CommonPaymentData commonPaymentData = buildCommonPaymentData(); PeriodicPayment actual = cmsToXs2APaymentSupportMapper.mapToPeriodicPayment(commonPaymentData); assertEquals(expectedPeriodicPayment, actual); }
@Test void mapToPeriodicPayment_null() { PeriodicPayment actual = cmsToXs2APaymentSupportMapper.mapToPeriodicPayment(null); assertNull(actual); }