@ExecuteOn(TaskExecutors.IO)
    @Get(uri = "distinct-namespaces")
    @Operation(tags = {"Templates"}, summary = "List all distinct namespaces")
    public List<String> listDistinctNamespace() {
        return templateRepository.findDistinctNamespace(tenantService.resolveTenant());
    }
@Test
    void listDistinctNamespace() {
        List<String> namespaces = client.toBlocking().retrieve(
            HttpRequest.GET("/api/v1/templates/distinct-namespaces"), Argument.listOf(String.class));
        assertThat(namespaces.size(), is(0));
            Template t1 = Template.builder()
            .id(IdUtils.create())
            .namespace("kestra.template.custom")
            .tasks(Arrays.asList(Return.builder().id("task").type(Return.class.getName()).format("test").build()))
            .build();
        client.toBlocking().retrieve(POST("/api/v1/templates", t1), Template.class);
        client.toBlocking().retrieve(POST("/api/v1/templates", createTemplate()), Template.class);
        client.toBlocking().retrieve(POST("/api/v1/templates", createTemplate()), Template.class);
        namespaces = client.toBlocking().retrieve(
            HttpRequest.GET("/api/v1/templates/distinct-namespaces"), Argument.listOf(String.class));

        assertThat(namespaces.size(), is(2));
    }