AllocationsResource extends BaseResource { @DELETE public void clearAllocations(@PathParam("experimentName") String experimentName) { ensureExists(experiments.get(experimentName)) .deallocateAll() .save(); } @Inject  AllocationsResource(Experiments experiments, Mappers mapper); @GET Iterable<AllocationDto> getAllocations(@PathParam("experimentName") String experimentName); @POST void updateAllocations(@PathParam("experimentName") String experimentName,
                                  @Valid List<AllocationRequest> requests); @DELETE void clearAllocations(@PathParam("experimentName") String experimentName);  }
@Test public void testClearAllocations() { delete(ALLOCATIONS_ENDPOINT, EXPERIMENT_BAD).assertStatus(Status.NOT_FOUND); delete(ALLOCATIONS_ENDPOINT, EXPERIMENT_1).assertStatus(Status.NO_CONTENT); assertTrue(experiment(EXPERIMENT_1).getAllocations().isEmpty()); }