void handleStatement(final QueuedCommand queuedCommand) {
    throwIfNotConfigured();

    handleStatementWithTerminatedQueries(
        queuedCommand.getAndDeserializeCommand(commandDeserializer),
        queuedCommand.getAndDeserializeCommandId(),
        queuedCommand.getStatus(),
        Mode.EXECUTE,
        queuedCommand.getOffset(),
        false
    );
  }
@Test
  public void shouldUpdateStatusOnCompletedPlannedCommand() {
    // Given:
    givenMockPlannedQuery();

    // When:
    handleStatement(
        statementExecutorWithMocks,
        plannedCommand,
        COMMAND_ID,
        Optional.of(status),
        0L
    );

    // Then:
    final InOrder inOrder = Mockito.inOrder(status, mockEngine);
    inOrder.verify(status).setStatus(
        new CommandStatus(Status.EXECUTING, "Executing statement"));
    inOrder.verify(mockEngine).execute(any(), any(ConfiguredKsqlPlan.class), any(Boolean.class));
    inOrder.verify(status).setFinalStatus(
        new CommandStatus(Status.SUCCESS, "Created query with ID qid", Optional.of(QUERY_ID)));
  }