### Question:
Unplug implements UserMessage { @Override public CompletableFuture<UserMessageResult> perform(StateManager stateManager) { return stateManager.cableUnplugged(evseId, connectorId); }  @Override CompletableFuture<UserMessageResult> perform(StateManager stateManager);  }### Answer:
@Test void shouldThrowExceptionWhenStateIsLocked() { when(evseMock.getEvseState()).thenReturn(new WaitingForAuthorizationState()); when(stationStoreMock.findEvse(anyInt())).thenReturn(evseMock); when(evseMock.findConnector(anyInt()).getCableStatus()).thenReturn(CableStatus.LOCKED); assertThrows(IllegalStateException.class, () -> unplug.perform(stateManagerMock)); }
@Test void verifyTransactionStatusNotification() { when(evseMock.getEvseState()).thenReturn(new StoppedState()); when(stationStoreMock.getTxStopPointValues()).thenReturn(new OptionList<>(Collections.singletonList(TxStartStopPointVariableValues.EV_CONNECTED))); unplug.perform(stateManagerMock); ArgumentCaptor<Subscriber<StatusNotificationRequest, StatusNotificationResponse>> subscriberCaptor = ArgumentCaptor.forClass(Subscriber.class); verify(stationMessageSenderMock).sendStatusNotificationAndSubscribe(any(Evse.class), any(Connector.class), subscriberCaptor.capture()); subscriberCaptor.getValue().onResponse(new StatusNotificationRequest(), new StatusNotificationResponse()); verify(stationMessageSenderMock).sendTransactionEventEnded(anyInt(), anyInt(), any(TransactionEventRequest.TriggerReason.class), nullable(TransactionData.StoppedReason.class), anyLong()); }