### Question:
SpiPaymentMapper { public SpiSinglePayment mapToSpiSinglePayment(SpiPayment spiPayment) { SpiPaymentInfo spiPaymentInfo = (SpiPaymentInfo) spiPayment; byte[] paymentData = spiPaymentInfo.getPaymentData(); SinglePayment xs2aSinglePayment = rawToXs2aPaymentMapper.mapToSinglePayment(paymentData); SpiSinglePayment spiSinglePayment = xs2aToSpiSinglePaymentMapper.mapToSpiSinglePayment(xs2aSinglePayment, spiPaymentInfo.getPaymentProduct()); spiSinglePayment.setPaymentId(spiPaymentInfo.getPaymentId()); spiSinglePayment.setPaymentProduct(spiPaymentInfo.getPaymentProduct()); spiSinglePayment.setPaymentStatus(spiPaymentInfo.getPaymentStatus()); spiSinglePayment.setPsuDataList(spiPaymentInfo.getPsuDataList()); spiSinglePayment.setStatusChangeTimestamp(spiPaymentInfo.getStatusChangeTimestamp()); spiSinglePayment.setCreationTimestamp(spiPaymentInfo.getCreationTimestamp()); return spiSinglePayment; }  SpiSinglePayment mapToSpiSinglePayment(SpiPayment spiPayment); SpiPeriodicPayment mapToSpiPeriodicPayment(SpiPayment spiPayment); SpiBulkPayment mapToSpiBulkPayment(SpiPayment spiPayment);  }### Answer:
@Test void mapToSpiSinglePayment() { SpiPaymentInfo spiPayment = buildSpiPaymentInfo(); byte[] paymentBody = jsonReader.getBytesFromFile("json/support/mapper/single-payment-initiation.json"); spiPayment.setPaymentData(paymentBody); SinglePayment xs2aSinglePayment = jsonReader.getObjectFromFile("json/support/mapper/raw-xs2a-single-payment.json", SinglePayment.class); when(rawToXs2aPaymentMapper.mapToSinglePayment(paymentBody)).thenReturn(xs2aSinglePayment); SpiSinglePayment baseSpiSinglePayment = buildBaseSpiSinglePayment(); when(xs2aToSpiSinglePaymentMapper.mapToSpiSinglePayment(xs2aSinglePayment, PAYMENT_PRODUCT)).thenReturn(baseSpiSinglePayment); SpiSinglePayment expectedPayment = buildEnrichedSpiSinglePayment(); SpiSinglePayment actualPayment = spiPaymentMapper.mapToSpiSinglePayment(spiPayment); assertEquals(expectedPayment, actualPayment); }