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