@Test
    void verifyYamlLoaderThrows() {
        val resource = resourceLoader.getResource("classpath:/badyaml.yml");
        val configurationLoaders = CasConfigurationPropertiesSourceLocator.getConfigurationPropertiesLoaders();
        val foundLoader = configurationLoaders
            .stream()
            .filter(loader -> loader.supports(resource))
            .findFirst()
            .orElseThrow();
        assertThrows(YAMLException.class, () -> foundLoader.load(resource, environment, "test", CipherExecutor.noOpOfStringToString()));
    }
This is {@link DefaultCasConfigurationPropertiesSourceLocatorTests}.

@author Misagh Moayyed
@since 5.3.0
core/cas-server-core-configuration/src/test/java/org/apereo/cas/configuration/support/DefaultCasConfigurationPropertiesSourceLocatorTests.java