### Question:
SpiPaymentMapper { public SpiPeriodicPayment mapToSpiPeriodicPayment(SpiPayment spiPayment) { SpiPaymentInfo spiPaymentInfo = (SpiPaymentInfo) spiPayment; byte[] paymentData = spiPaymentInfo.getPaymentData(); PeriodicPayment xs2aPeriodicPayment = rawToXs2aPaymentMapper.mapToPeriodicPayment(paymentData); SpiPeriodicPayment spiPeriodicPayment = xs2aToSpiPeriodicPaymentMapper.mapToSpiPeriodicPayment(xs2aPeriodicPayment, spiPaymentInfo.getPaymentProduct()); spiPeriodicPayment.setPaymentId(spiPaymentInfo.getPaymentId()); spiPeriodicPayment.setPaymentProduct(spiPaymentInfo.getPaymentProduct()); spiPeriodicPayment.setPaymentStatus(spiPaymentInfo.getPaymentStatus()); spiPeriodicPayment.setPsuDataList(spiPaymentInfo.getPsuDataList()); spiPeriodicPayment.setStatusChangeTimestamp(spiPaymentInfo.getStatusChangeTimestamp()); spiPeriodicPayment.setCreationTimestamp(spiPaymentInfo.getCreationTimestamp()); return spiPeriodicPayment; }  SpiSinglePayment mapToSpiSinglePayment(SpiPayment spiPayment); SpiPeriodicPayment mapToSpiPeriodicPayment(SpiPayment spiPayment); SpiBulkPayment mapToSpiBulkPayment(SpiPayment spiPayment);  }### Answer:
@Test void mapToSpiPeriodicPayment() { SpiPaymentInfo spiPayment = buildSpiPaymentInfo(); byte[] paymentBody = jsonReader.getBytesFromFile("json/support/mapper/periodic-payment-initiation.json"); spiPayment.setPaymentData(paymentBody); PeriodicPayment xs2aPeriodicPayment = jsonReader.getObjectFromFile("json/support/mapper/raw-xs2a-periodic-payment.json", PeriodicPayment.class); when(rawToXs2aPaymentMapper.mapToPeriodicPayment(paymentBody)).thenReturn(xs2aPeriodicPayment); SpiPeriodicPayment baseSpiPeriodicPayment = buildBaseSpiPeriodicPayment(); when(xs2aToSpiPeriodicPaymentMapper.mapToSpiPeriodicPayment(xs2aPeriodicPayment, PAYMENT_PRODUCT)).thenReturn(baseSpiPeriodicPayment); SpiPeriodicPayment expectedPayment = buildEnrichedSpiPeriodicPayment(); SpiPeriodicPayment actualPayment = spiPaymentMapper.mapToSpiPeriodicPayment(spiPayment); assertEquals(expectedPayment, actualPayment); }