@Override
    public void suspend(Throwable cause) {
        context.goToFinished(context.getArchivedExecutionGraph(JobStatus.SUSPENDED, cause));
    }
@Test
    void testSuspendTransitionsToFinished() {
        FlinkException expectedException = new FlinkException("This is a test exception");
        TestingStateWithoutExecutionGraph state = new TestingStateWithoutExecutionGraph(ctx, LOG);

        ctx.setExpectFinished(
                archivedExecutionGraph -> {
                    assertThat(archivedExecutionGraph.getState()).isEqualTo(JobStatus.SUSPENDED);
                    assertThat(archivedExecutionGraph.getFailureInfo()).isNotNull();
                    assertThat(
                                    archivedExecutionGraph
                                            .getFailureInfo()
                                            .getException()
                                            .deserializeError(this.getClass().getClassLoader()))
                            .isEqualTo(expectedException);
                });

        state.suspend(expectedException);
    }