@VisibleForTesting
    public static JobGraph createJobGraph(StreamGraph streamGraph) {
        return new StreamingJobGraphGenerator(
                        Thread.currentThread().getContextClassLoader(),
                        streamGraph,
                        null,
                        Runnable::run)
                .createJobGraph();
    }
@Test
    void testStreamConfigSerializationException() {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        DataStreamSource<Integer> source = env.fromData(1, 2, 3);
        env.addOperator(
                new OneInputTransformation<>(
                        source.getTransformation(),
                        "serializationTestOperator",
                        // using a non-serializable operator factory to trigger an IOException when
                        // try to serialize streamConfig.
                        new SerializationTestOperatorFactory(false),
                        Types.INT,
                        1));
        final StreamGraph streamGraph = env.getStreamGraph();
        assertThatThrownBy(() -> StreamingJobGraphGenerator.createJobGraph(streamGraph))
                .hasRootCauseInstanceOf(IOException.class)
                .hasRootCauseMessage("This operator factory is not serializable.");
    }