@Override
    public Integer call() throws Exception {
        return this.call(
            Template.class,
            yamlFlowParser,
            modelValidator,
            (Object object) -> {
                Template template = (Template) object;
                return template.getNamespace() + " / " + template.getId();
            },
            (Object object) -> Collections.emptyList()
        );
    }
@Test
    void runServer()  {
        URL directory = TemplateValidateCommandTest.class.getClassLoader().getResource("invalidsTemplates/template.yml");
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        System.setErr(new PrintStream(out));

        try (ApplicationContext ctx = ApplicationContext.run(Map.of("kestra.templates.enabled", "true"), Environment.CLI, Environment.TEST)) {

            EmbeddedServer embeddedServer = ctx.getBean(EmbeddedServer.class);
            embeddedServer.start();

            String[] args = {
                "--server",
                embeddedServer.getURL().toString(),
                "--user",
                "myuser:pass:word",
                directory.getPath()
            };
            Integer call = PicocliRunner.call(TemplateValidateCommand.class, ctx, args);

            assertThat(call, is(1));
            assertThat(out.toString(), containsString("Unable to parse template"));
            assertThat(out.toString(), containsString("must not be empty"));
        }
    }