public static FailoverStrategy.Factory loadFailoverStrategyFactory(final Configuration config) {
        checkNotNull(config);

        final String strategyParam = config.get(JobManagerOptions.EXECUTION_FAILOVER_STRATEGY);

        switch (strategyParam.toLowerCase()) {
            case FULL_RESTART_STRATEGY_NAME:
                return new RestartAllFailoverStrategy.Factory();

            case PIPELINED_REGION_RESTART_STRATEGY_NAME:
                return new RestartPipelinedRegionFailoverStrategy.Factory();

            default:
                throw new IllegalConfigurationException(
                        "Unknown failover strategy: " + strategyParam);
        }
    }
@Test
    void testLoadFromInvalidConfiguration() {
        final Configuration config = new Configuration();
        config.set(JobManagerOptions.EXECUTION_FAILOVER_STRATEGY, "invalidStrategy");
        assertThatThrownBy(() -> FailoverStrategyFactoryLoader.loadFailoverStrategyFactory(config))
                .isInstanceOf(IllegalConfigurationException.class);
    }