### Question:
ObaCancellationController implements ObaCancellationApi { @Override public ResponseEntity<SCAPaymentResponseTO> initCancellation(String paymentId) { SCAPaymentResponseTO response = paymentRestClient.initiatePmtCancellation(paymentId).getBody(); HttpStatus status = resolveStatus(paymentId, response); return new ResponseEntity<>(response, status); }  @Override ResponseEntity<SCAPaymentResponseTO> initCancellation(String paymentId); @Override ResponseEntity<SCAPaymentResponseTO> selectSca(String paymentId, String cancellationId, String scaMethodId); @Override ResponseEntity<Void> validateTAN(String paymentId, String cancellationId, String authCode);  }### Answer:
@Test void initCancellation_no_sca() { when(paymentRestClient.initiatePmtCancellation(PMT_ID)).thenReturn(getResponse(ScaStatusTO.EXEMPTED, TransactionStatusTO.ACSP, false, false, OK)); when(cmsPsuPisService.updatePaymentStatus(PMT_ID, TransactionStatus.CANC, DEFAULT_SERVICE_INSTANCE_ID)).thenReturn(true); ResponseEntity<SCAPaymentResponseTO> result = controller.initCancellation(PMT_ID); assertEquals(getResponse(ScaStatusTO.EXEMPTED, TransactionStatusTO.ACSP, false, false, NO_CONTENT), result); }
@Test void initCancellation() { when(paymentRestClient.initiatePmtCancellation(PMT_ID)).thenReturn(getResponse(ScaStatusTO.PSUIDENTIFIED, TransactionStatusTO.ACSP, true, false, OK)); ResponseEntity<SCAPaymentResponseTO> result = controller.initCancellation(PMT_ID); assertEquals(getResponse(ScaStatusTO.EXEMPTED, TransactionStatusTO.ACSP, true, false, OK), result); }
@Test void initCancellation_no_sca_fail() { when(paymentRestClient.initiatePmtCancellation(PMT_ID)).thenReturn(getResponse(ScaStatusTO.EXEMPTED, TransactionStatusTO.ACSP, false, false, OK)); when(cmsPsuPisService.updatePaymentStatus(PMT_ID, TransactionStatus.CANC, DEFAULT_SERVICE_INSTANCE_ID)).thenReturn(false); ResponseEntity<SCAPaymentResponseTO> result = controller.initCancellation(PMT_ID); assertEquals(getResponse(ScaStatusTO.EXEMPTED, TransactionStatusTO.ACSP, false, false, BAD_REQUEST), result); }