@ExecuteOn(TaskExecutors.IO)
    @Delete(uri = "{namespace}/{id}")
    @Operation(tags = {"Templates"}, summary = "Delete a template")
    @ApiResponse(responseCode = "204", description = "On success")
    public HttpResponse<Void> delete(
        @Parameter(description = "The template namespace") @PathVariable String namespace,
        @Parameter(description = "The template id") @PathVariable String id
    ) {
        Optional<Template> template = templateRepository.findById(tenantService.resolveTenant(), namespace, id);
        if (template.isPresent()) {
            templateRepository.delete(template.get());
            return HttpResponse.status(HttpStatus.NO_CONTENT);
        } else {
            return HttpResponse.status(HttpStatus.NOT_FOUND);
        }
    }
@Test
    void importTemplatesWithYaml() throws IOException {
        var yaml = createTemplate().generateSource() + "---" +
            createTemplate().generateSource() + "---" +
            createTemplate().generateSource();

        var temp = File.createTempFile("templates", ".yaml");
        Files.writeString(temp.toPath(), yaml);
        var body = MultipartBody.builder()
            .addPart("fileUpload", "templates.yaml", temp)
            .build();
        var response = client.toBlocking().exchange(POST("/api/v1/templates/import", body).contentType(MediaType.MULTIPART_FORM_DATA));

        assertThat(response.getStatus(), is(NO_CONTENT));
        temp.delete();
    }