@Test public void unsetConfigs() { WebTarget wt = target(); try { wt.path("configuration/foo").request().delete(); } catch (BadRequestException e) { assertEquals("incorrect key", "foo", service.component); assertEquals("incorrect key", "k", service.name); assertEquals("incorrect value", null, service.value); } }
@DELETE @Consumes(MediaType.APPLICATION_JSON) @Path("{component}") public Response unsetConfigs(@PathParam("component") String component, InputStream request) throws IOException { ComponentConfigService service = get(ComponentConfigService.class); ObjectNode props = (ObjectNode) mapper().readTree(request); props.fieldNames().forEachRemaining(k -> service.unsetProperty(component, k)); return Response.noContent().build(); }
ComponentConfigWebResource extends AbstractWebResource { @DELETE @Consumes(MediaType.APPLICATION_JSON) @Path("{component}") public Response unsetConfigs(@PathParam("component") String component, InputStream request) throws IOException { ComponentConfigService service = get(ComponentConfigService.class); ObjectNode props = (ObjectNode) mapper().readTree(request); props.fieldNames().forEachRemaining(k -> service.unsetProperty(component, k)); return Response.noContent().build(); } }
ComponentConfigWebResource extends AbstractWebResource { @DELETE @Consumes(MediaType.APPLICATION_JSON) @Path("{component}") public Response unsetConfigs(@PathParam("component") String component, InputStream request) throws IOException { ComponentConfigService service = get(ComponentConfigService.class); ObjectNode props = (ObjectNode) mapper().readTree(request); props.fieldNames().forEachRemaining(k -> service.unsetProperty(component, k)); return Response.noContent().build(); }  }
ComponentConfigWebResource extends AbstractWebResource { @DELETE @Consumes(MediaType.APPLICATION_JSON) @Path("{component}") public Response unsetConfigs(@PathParam("component") String component, InputStream request) throws IOException { ComponentConfigService service = get(ComponentConfigService.class); ObjectNode props = (ObjectNode) mapper().readTree(request); props.fieldNames().forEachRemaining(k -> service.unsetProperty(component, k)); return Response.noContent().build(); }  @GET @Produces(MediaType.APPLICATION_JSON) Response getComponentConfigs(); @GET @Path("{component}") @Produces(MediaType.APPLICATION_JSON) Response getComponentConfigs(@PathParam("component") String component); @POST @Consumes(MediaType.APPLICATION_JSON) @Path("{component}") Response setConfigs(@PathParam("component") String component,
                               InputStream request); @DELETE @Consumes(MediaType.APPLICATION_JSON) @Path("{component}") Response unsetConfigs(@PathParam("component") String component,
                                 InputStream request); }
ComponentConfigWebResource extends AbstractWebResource { @DELETE @Consumes(MediaType.APPLICATION_JSON) @Path("{component}") public Response unsetConfigs(@PathParam("component") String component, InputStream request) throws IOException { ComponentConfigService service = get(ComponentConfigService.class); ObjectNode props = (ObjectNode) mapper().readTree(request); props.fieldNames().forEachRemaining(k -> service.unsetProperty(component, k)); return Response.noContent().build(); }  @GET @Produces(MediaType.APPLICATION_JSON) Response getComponentConfigs(); @GET @Path("{component}") @Produces(MediaType.APPLICATION_JSON) Response getComponentConfigs(@PathParam("component") String component); @POST @Consumes(MediaType.APPLICATION_JSON) @Path("{component}") Response setConfigs(@PathParam("component") String component,
                               InputStream request); @DELETE @Consumes(MediaType.APPLICATION_JSON) @Path("{component}") Response unsetConfigs(@PathParam("component") String component,
                                 InputStream request);  }