package org.apereo.cas.services.util;

import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;

/**
 * This is {@link RegisteredServiceYamlSerializer}.
 *
 * @author Misagh Moayyed
 * @since 5.0.0
 */
public class RegisteredServiceYamlSerializer extends DefaultRegisteredServiceJsonSerializer {
    private static final long serialVersionUID = -6026921045861422473L;

    @Override
    protected JsonFactory getJsonFactory() {
        return new YAMLFactory();
    }
}

@@ -136,16 +136,120 @@
 Factory;
+%0Aimport org.apache.commons.io.FileUtils;%0A%0Aimport java.io.File;%0Aimport java.nio.charset.StandardCharsets;
 %0A%0A/**%0A *
@@ -612,11 +612,325 @@
 );%0A    %7D
+%0A%0A    @Override%0A    public boolean supports(final File file) %7B%0A        try %7B%0A            final String contents = FileUtils.readFileToString(file, StandardCharsets.UTF_8.name()).trim();%0A            return contents.startsWith(%22--- !%3C%22);%0A        %7D catch (final Exception e) %7B%0A            return false;%0A        %7D%0A    %7D
 %0A%7D%0A

Fix test failures with yaml