### Question:
ChargingStationOcpp12SoapClient implements ChargingStationOcpp12Client { @Override public boolean stopTransaction(ChargingStationId id, int transactionId) { LOG.debug("Stopping transaction {} on {}", transactionId, id); ChargePointService chargePointService = this.createChargingStationService(id); RemoteStopTransactionRequest request = new RemoteStopTransactionRequest(); request.setTransactionId(transactionId); RemoteStopTransactionResponse response; response = chargePointService.remoteStopTransaction(request, id.getId()); boolean willTransactionStop; switch (response.getStatus()) { case ACCEPTED: LOG.info("Remote stop transaction request on {} has been accepted", id); willTransactionStop = true; break; case REJECTED: LOG.info("Remote stop transaction request on {} has been rejected", id); willTransactionStop = false; break; default: throw new AssertionError("Stop transaction returned unknown response status " + response.getStatus()); } return willTransactionStop; }  @Override boolean startTransaction(ChargingStationId id, IdentifyingToken identifyingToken, EvseId evseId); @Override boolean stopTransaction(ChargingStationId id, int transactionId); @Override boolean softReset(ChargingStationId id); @Override boolean hardReset(ChargingStationId id); @Override RequestResult unlockConnector(ChargingStationId id, EvseId evseId); @Override RequestResult changeAvailabilityToInoperative(ChargingStationId id, EvseId evseId); @Override RequestResult changeAvailabilityToOperative(ChargingStationId id, EvseId evseId); @Override boolean changeConfiguration(ChargingStationId id, ConfigurationItem configurationItem); @Override String getDiagnostics(ChargingStationId id, DiagnosticsUploadSettings diagnosticsUploadSettings); @Override boolean clearCache(ChargingStationId id); @Override void updateFirmware(ChargingStationId id, String downloadLocation, Date retrieveDate, Integer numRetries, Integer retryInterval); void setDomainService(DomainService domainService); void setChargingStationProxyFactory(ChargingStationProxyFactory chargingStationProxyFactory);  }### Answer:
@Test public void stopTransactionAcceptedVerifyReturnValue() { when(chargePointService.remoteStopTransaction(any(RemoteStopTransactionRequest.class), anyString())).thenReturn(getRemoteStopTransactionResponse(RemoteStartStopStatus.ACCEPTED)); boolean willTransactionStop = client.stopTransaction(CHARGING_STATION_ID, ((NumberedTransactionId) TRANSACTION_ID).getNumber()); assertTrue(willTransactionStop); }
@Test public void stopTransactionRejectedVerifyReturnValue() { when(chargePointService.remoteStopTransaction(any(RemoteStopTransactionRequest.class), anyString())).thenReturn(getRemoteStopTransactionResponse(RemoteStartStopStatus.REJECTED)); boolean willTransactionStop = client.stopTransaction(CHARGING_STATION_ID, ((NumberedTransactionId) TRANSACTION_ID).getNumber()); assertFalse(willTransactionStop); }
@Test public void stopTransactionVerifyServiceCall() { when(chargePointService.remoteStopTransaction(any(RemoteStopTransactionRequest.class), anyString())).thenReturn(getRemoteStopTransactionResponse(RemoteStartStopStatus.ACCEPTED)); ArgumentCaptor<RemoteStopTransactionRequest> remoteStopTransactionRequestArgument = ArgumentCaptor.forClass(RemoteStopTransactionRequest.class); client.stopTransaction(CHARGING_STATION_ID, ((NumberedTransactionId) TRANSACTION_ID).getNumber()); verify(chargePointService).remoteStopTransaction(remoteStopTransactionRequestArgument.capture(), eq(CHARGING_STATION_ID.getId())); assertEquals(((NumberedTransactionId) TRANSACTION_ID).getNumber(), remoteStopTransactionRequestArgument.getValue().getTransactionId()); }