@Test public void testGetOverrides() { get(ENDPOINT_OVERRIDES, EXPERIMENT_BAD) .assertStatus(Status.NOT_FOUND); final Iterable<TreatmentOverrideDto> expected = MAPPER.toDto( experiment(EXPERIMENT_1).getOverrides(), TreatmentOverrideDto.class ); final Iterable<TreatmentOverrideDto> actual = get(ENDPOINT_OVERRIDES, EXPERIMENT_1) .assertStatus(Status.OK) .result(iterable(TreatmentOverrideDto.class)); assertEquals(expected, actual); }
@GET public Iterable<TreatmentOverrideDto> getOverrides(@PathParam("experimentName") String experimentName) { return mapper.toDto( ensureExists(experiments.get(experimentName)).getOverrides(), TreatmentOverrideDto.class ); }
TreatmentOverridesResource extends BaseResource { @GET public Iterable<TreatmentOverrideDto> getOverrides(@PathParam("experimentName") String experimentName) { return mapper.toDto( ensureExists(experiments.get(experimentName)).getOverrides(), TreatmentOverrideDto.class ); } }
TreatmentOverridesResource extends BaseResource { @GET public Iterable<TreatmentOverrideDto> getOverrides(@PathParam("experimentName") String experimentName) { return mapper.toDto( ensureExists(experiments.get(experimentName)).getOverrides(), TreatmentOverrideDto.class ); } @Inject  TreatmentOverridesResource(Experiments experiments, Mappers mapper); }
TreatmentOverridesResource extends BaseResource { @GET public Iterable<TreatmentOverrideDto> getOverrides(@PathParam("experimentName") String experimentName) { return mapper.toDto( ensureExists(experiments.get(experimentName)).getOverrides(), TreatmentOverrideDto.class ); } @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); }
TreatmentOverridesResource extends BaseResource { @GET public Iterable<TreatmentOverrideDto> getOverrides(@PathParam("experimentName") String experimentName) { return mapper.toDto( ensureExists(experiments.get(experimentName)).getOverrides(), TreatmentOverrideDto.class ); } @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);  }