@Test
    void verifyResourceExists() {
        assertThrows(IllegalArgumentException.class, () -> ResourceUtils.getRawResourceFrom(null));
        assertFalse(ResourceUtils.doesResourceExist(new FileSystemResource("invalid.json")));
        val resourceLoader = mock(ResourceLoader.class);
        when(resourceLoader.getResource(anyString())).thenThrow(new RuntimeException());
        assertFalse(ResourceUtils.doesResourceExist("bad-resource", resourceLoader));
        assertFalse(ResourceUtils.doesResourceExist(null, resourceLoader));
        assertFalse(ResourceUtils.doesResourceExist("invalid.json"));
        assertTrue(ResourceUtils.doesResourceExist("classpath:valid.json",
            new DefaultResourceLoader(ResourceUtilsTests.class.getClassLoader())));
    }
This is {@link ResourceUtilsTests}.

@author Misagh Moayyed
@since 5.3.0
core/cas-server-core-util/src/test/java/org/apereo/cas/util/ResourceUtilsTests.java