ExperimentTemplateRestApi { @GET @Operation(summary = "List of ExperimentTemplates", tags = {"experimentTemplates"}, responses = { @ApiResponse(description = "successful operation", content = @Content( schema = @Schema( implementation = JsonResponse.class)))}) public Response listExperimentTemplate(@QueryParam("status") String status) { try { List<ExperimentTemplate> experimentTemplateList = experimentTemplateManager.listExperimentTemplates(status); return new JsonResponse.Builder<List<ExperimentTemplate>>(Response.Status.OK) .success(true).result(experimentTemplateList).build(); } catch (SubmarineRuntimeException e) { return parseExperimentTemplateServiceException(e); } }  @POST @Consumes({RestConstants.MEDIA_TYPE_YAML, MediaType.APPLICATION_JSON}) @Operation(summary = "Create a experimentTemplate", tags = {"experimentTemplate"}, responses = { @ApiResponse(description = "successful operation", content = @Content( schema = @Schema( implementation = JsonResponse.class)))}) Response createExperimentTemplate(ExperimentTemplateSpec spec); @PATCH @Path("/{id}") @Consumes({RestConstants.MEDIA_TYPE_YAML, MediaType.APPLICATION_JSON}) @Operation(summary = "Update the experimentTemplate with job spec", tags = {"experimentTemplates"}, responses = { @ApiResponse(description = "successful operation", content = @Content( schema = @Schema( implementation = JsonResponse.class))), @ApiResponse( responseCode = "404", description = "ExperimentTemplate not found")}) Response updateExperimentTemplate(
      @PathParam(RestConstants.EXPERIMENT_TEMPLATE_ID) String name,
      ExperimentTemplateSpec spec); @DELETE @Path("/{id}") @Operation(summary = "Delete the experimentTemplate", tags = {"experimentTemplates"}, responses = { @ApiResponse(description = "successful operation", content = @Content( schema = @Schema(implementation = JsonResponse.class))), @ApiResponse( responseCode = "404", description = "ExperimentTemplate not found")}) Response deleteExperimentTemplate(
      @PathParam(RestConstants.EXPERIMENT_TEMPLATE_ID) String name); @GET @Operation(summary = "List of ExperimentTemplates", tags = {"experimentTemplates"}, responses = { @ApiResponse(description = "successful operation", content = @Content( schema = @Schema( implementation = JsonResponse.class)))}) Response listExperimentTemplate(@QueryParam("status") String status); @GET @Path("/{id}") @Operation(summary = "Find experimentTemplate by name", tags = {"experimentTemplate"}, responses = { @ApiResponse(description = "successful operation", content = @Content( schema = @Schema(implementation = JsonResponse.class))), @ApiResponse( responseCode = "404", description = "ExperimentTemplate not found")}) Response getExperimentTemplate(
      @PathParam(RestConstants.EXPERIMENT_TEMPLATE_ID) String name);  }
@Test public void listExperimentTemplate() { String body = loadContent(TPL_FILE); experimentTemplateSpec = gson.fromJson(body, ExperimentTemplateSpec.class); Response getEnvResponse = experimentTemplateStoreApi.listExperimentTemplate(""); String entity = (String) getEnvResponse.getEntity(); JsonResponse jsonResponse = gson.fromJson(entity, JsonResponse.class); ExperimentTemplate[] experimentTemplates = gson.fromJson(gson.toJson(jsonResponse.getResult()), ExperimentTemplate[].class); assertEquals(1, experimentTemplates.length); ExperimentTemplate experimentTemplate = experimentTemplates[0]; assertEquals(experimentTemplateSpec.getName(), experimentTemplate.getExperimentTemplateSpec().getName()); }