public static ConfigRepoConfig createConfigRepoConfig(MaterialConfig repo, String pluginId, String id) {
        return (ConfigRepoConfig) new ConfigRepoConfig().setRepo(repo).setPluginId(pluginId).setId(id);
    }
@Test
    public void validateTree_configRepoShouldBeInvalidIfMaterialConfigHasErrors() {
        CruiseConfig cruiseConfig = new BasicCruiseConfig();
        MaterialConfig materialConfig = new GitMaterialConfig(); // should be invalid since URL is not set

        ConfigRepoConfig configRepoConfig = ConfigRepoConfig.createConfigRepoConfig(materialConfig, "plug", "id");
        cruiseConfig.setConfigRepos(new ConfigReposConfig(configRepoConfig));
        ConfigSaveValidationContext validationContext = ConfigSaveValidationContext.forChain(cruiseConfig);

        configRepoConfig.validateTree(validationContext);
        assertThat(configRepoConfig.errors().isEmpty()).isTrue();
        assertThat(configRepoConfig.getRepo().errors().isEmpty()).isFalse();
    }