FlyteAdminClientRunner implements FlyteRunner { @VisibleForTesting void emitFlyteEvents(ExecutionOuterClass.Execution execution, RunState runState) throws IsClosedException { final List<Event> events = translate(execution, runState); for (Event event : events) { stateManager.receive(event); } } @VisibleForTesting  FlyteAdminClientRunner(final String runnerId,
                         final FlyteAdminClient flyteAdminClient,
                         final StateManager stateManager,
                         final Duration terminateDanglingFlyteExecInterval,
                         final ScheduledExecutorService scheduledExecutor,
                         final Time time);   FlyteAdminClientRunner(final String runnerId,
                         final FlyteAdminClient flyteAdminClient,
                         final StateManager stateManager); @Override String createExecution(final RunState runState, final String execName, final FlyteExecConf flyteExecConf,
                                final Map<String, String> annotations); @Override void terminateExecution(RunState runState, FlyteExecutionId flyteExecutionId); @Override void poll(FlyteExecutionId flyteExecutionId, RunState runState); @Override void close();  }
@Test public void testEmitFlyteEventsExceptionHandling() throws IsClosedException { doThrow(new IsClosedException()) .when(stateManager).receive(Event.terminate(WORKFLOW_INSTANCE, Optional.of(SUCCESS_EXIT_CODE))); assertThrows( IsClosedException.class, () -> flyteRunner.emitFlyteEvents(ExecutionOuterClass.Execution.newBuilder().setClosure( ExecutionOuterClass.ExecutionClosure.newBuilder().setPhase( Execution.WorkflowExecution.Phase.SUCCEEDED).build()).build(), RUN_STATE)); }