TreatmentOverridesResource extends BaseResource { @DELETE @Path("/{overrideName}") public void removeOverride(@PathParam("experimentName") String experimentName, @PathParam("overrideName") String overrideName) { final Experiment experiment = ensureExists(experiments.get(experimentName)); ensureExists(experiment.getOverride(overrideName)); experiment .removeOverride(overrideName) .save(); } @Inject  TreatmentOverridesResource(Experiments experiments, Mappers mapper); @GET @Path("/{overrideName}") TreatmentOverrideDto getOverride(@PathParam("experimentName") String experimentName,
                                            @PathParam("overrideName") String overrideName); @GET Iterable<TreatmentOverrideDto> getOverrides(@PathParam("experimentName") String experimentName); @PUT Response addOverride(@PathParam("experimentName") String experimentName,
                                @Valid TreatmentOverrideRequest request); @DELETE void clearOverrides(@PathParam("experimentName") String experimentName); @DELETE @Path("/{overrideName}") void removeOverride(@PathParam("experimentName") String experimentName,
                               @PathParam("overrideName") String overrideName);  }
@Test public void testRemoveOverride() { delete(ENDPOINT_OVERRIDE, EXPERIMENT_BAD, EXP_1_OVERRIDE) .assertStatus(Status.NOT_FOUND); delete(ENDPOINT_OVERRIDE, EXPERIMENT_1, OVERRIDE_BAD) .assertStatus(Status.NOT_FOUND); assertNotNull(experiment(EXPERIMENT_1).getOverride(EXP_1_OVERRIDE)); delete(ENDPOINT_OVERRIDE, EXPERIMENT_1, EXP_1_OVERRIDE) .assertStatus(Status.NO_CONTENT); assertNull(experiment(EXPERIMENT_1).getOverride(EXP_1_OVERRIDE)); }