@Test
    void verifyExport() throws Throwable {
        val resourceName = "META-INF/additional-spring-configuration-metadata.json";
        val url = getClass().getClassLoader().getResource(resourceName);
        assertNotNull(url);
        val parent = FileUtils.getTempDirectory();
        assertNull(ResourceUtils.exportClasspathResourceToFile(parent, null));
        assertNotNull(ResourceUtils.exportClasspathResourceToFile(parent, new UrlResource(url)));

        try (val appCtx = new StaticApplicationContext()) {
            appCtx.refresh();
            assertDoesNotThrow(() -> ResourceUtils.exportResources(appCtx, parent,
                List.of("classpath:/" + resourceName)));
        }
        assertTrue(new File(parent, FilenameUtils.getName(resourceName)).exists());
        
        val res = new ClassPathResource("valid.json");
        val file = new File(FileUtils.getTempDirectory(), "/one/two");
        FileUtils.write(new File(file, Objects.requireNonNull(res.getFilename())), "data", StandardCharsets.UTF_8);
        assertNotNull(ResourceUtils.exportClasspathResourceToFile(file, res));
    }
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