@Test
    void verifyOperation() throws Throwable {
        val appCtx = new StaticApplicationContext();
        appCtx.refresh();
        val file = File.createTempFile("service", ".json");
        val yaml = File.createTempFile("service", ".yaml");
        val svc = RegisteredServiceTestUtils.getRegisteredService("example");
        try (val writer = Files.newBufferedWriter(file.toPath(), StandardCharsets.UTF_8)) {
            new RegisteredServiceJsonSerializer(appCtx).to(writer, svc);
        }
        assertTrue(file.exists() && file.length() > 0);
        assertDoesNotThrow(() -> runShellCommand(() -> () -> "generate-yaml --file " + file.getPath() + " --destination " + yaml.getPath()));
        assertTrue(yaml.exists());
        val badFile = File.createTempFile("first", ".second");
        assertDoesNotThrow(() -> runShellCommand(() -> () -> "generate-yaml --file " + badFile + " --destination " + yaml.getPath()));
        FileUtils.write(badFile, "data", StandardCharsets.UTF_8);
        assertDoesNotThrow(() -> runShellCommand(() -> () -> "generate-yaml --file " + badFile + " --destination " + yaml.getPath()));
    }
This is {@link GenerateYamlRegisteredServiceCommandTests}.

@author Misagh Moayyed
@since 6.2.0
support/cas-server-support-shell/src/test/java/org/apereo/cas/shell/commands/services/GenerateYamlRegisteredServiceCommandTests.java