@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); }
@Override public ResponseEntity<SCAPaymentResponseTO> initCancellation(String paymentId) { SCAPaymentResponseTO response = paymentRestClient.initiatePmtCancellation(paymentId).getBody(); HttpStatus status = resolveStatus(paymentId, response); return new ResponseEntity<>(response, status); }
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); } }
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); }  }
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); }
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);  }