@Override
    protected DefaultDispatcherResourceManagerComponentFactory
            createDispatcherResourceManagerComponentFactory(Configuration configuration)
                    throws IOException {
        return DefaultDispatcherResourceManagerComponentFactory.createJobComponentFactory(
                YarnResourceManagerFactory.getInstance(),
                FileJobGraphRetriever.createFrom(
                        configuration,
                        YarnEntrypointUtils.getUsrLibDir(configuration).orElse(null)));
    }
@Test
    void testCreateDispatcherResourceManagerComponentFactoryFailIfUsrLibDirDoesNotExist() {
        final Configuration configuration = new Configuration();
        configuration.set(
                YarnConfigOptions.CLASSPATH_INCLUDE_USER_JAR,
                YarnConfigOptions.UserJarInclusion.DISABLED);
        final YarnJobClusterEntrypoint yarnJobClusterEntrypoint =
                new YarnJobClusterEntrypoint(configuration);
        assertThatThrownBy(
                        () ->
                                yarnJobClusterEntrypoint
                                        .createDispatcherResourceManagerComponentFactory(
                                                configuration))
                .isInstanceOf(IllegalStateException.class)
                .hasMessageContaining("the usrlib directory does not exist.");
    }