### Question:
PeriodicPaymentSpiImpl extends AbstractPaymentSpi<SpiPeriodicPayment, SpiPeriodicPaymentInitiationResponse> implements PeriodicPaymentSpi { @Override public @NotNull SpiResponse<SpiPeriodicPayment> getPaymentById(@NotNull SpiContextData contextData, @NotNull String acceptMediaType, @NotNull SpiPeriodicPayment payment, @NotNull SpiAspspConsentDataProvider aspspConsentDataProvider) { payment.setDebtorName(DEBTOR_NAME); return paymentService.getPaymentById(payment, aspspConsentDataProvider, paymentMapper::mapToSpiPeriodicPayment); } @Autowired  PeriodicPaymentSpiImpl(GeneralPaymentService paymentService, LedgersSpiPaymentMapper paymentMapper); @Override @NotNull SpiResponse<SpiPeriodicPayment> getPaymentById(@NotNull SpiContextData contextData,
                                                                   @NotNull String acceptMediaType,
                                                                   @NotNull SpiPeriodicPayment payment,
                                                                   @NotNull SpiAspspConsentDataProvider aspspConsentDataProvider); @Override @NotNull SpiResponse<SpiPaymentConfirmationCodeValidationResponse> notifyConfirmationCodeValidation(@NotNull SpiContextData spiContextData, boolean confirmationCodeValidationResult, @NotNull SpiPeriodicPayment payment, boolean isCancellation, @NotNull SpiAspspConsentDataProvider spiAspspConsentDataProvider);  }### Answer:
@Test void getPaymentById() { when(paymentService.getPaymentById(eq(payment), eq(spiAspspConsentDataProvider), any())) .thenReturn(SpiResponse.<SpiPeriodicPayment>builder() .payload(new SpiPeriodicPayment(PAYMENT_PRODUCT)) .build()); paymentSpi.getPaymentById(SPI_CONTEXT_DATA, JSON_ACCEPT_MEDIA_TYPE, payment, spiAspspConsentDataProvider); verify(paymentService, times(1)).getPaymentById(eq(payment), eq(spiAspspConsentDataProvider), any()); }