@Subscribe
    public void inputDeleted(InputDeleted inputDeletedEvent) {
        LOG.debug("Input deleted: {}", inputDeletedEvent.id());
        final IOState<MessageInput> inputState = inputRegistry.getInputState(inputDeletedEvent.id());
        if (inputState != null) {
            inputRegistry.remove(inputState);
        }
    }
@Test
    public void inputDeletedDoesNothingIfInputIsNotRunning() throws Exception {
        final String inputId = "input-id";
        @SuppressWarnings("unchecked")
        final IOState<MessageInput> inputState = mock(IOState.class);
        when(inputState.getState()).thenReturn(null);
        when(inputRegistry.getInputState(inputId)).thenReturn(inputState);

        listener.inputDeleted(InputDeleted.create(inputId));

        verify(inputRegistry, never()).remove(any(MessageInput.class));
    }