HaproxyResources { @GET @Path("/ids") @Produces(MediaType.APPLICATION_JSON) public Set<String> getHaproxyIds(@Auth final User user) { return repository.getHaproxyIds(); } HaproxyResources(HaproxyRepository repository, TemplateLocator templateLocator, TemplateGenerator templateGenerator); @PUT @Path("/{haproxyId}") @Consumes(MediaType.APPLICATION_JSON) Response createHaproxy(@Auth final User user, @PathParam("haproxyId") String haproxyId, @Valid HaproxyMappingJson haproxyMappingJson); @PUT @Path("/{haproxyId}/binding/{bindingId}") @Consumes(MediaType.TEXT_PLAIN) @Produces(MediaType.TEXT_PLAIN) Response setHaproxyBindings(@Auth final User user,  @PathParam("haproxyId") String haproxyId, @PathParam("bindingId") String bindingId, @NotEmpty String value); @GET @Path("/{haproxyId}/binding/{bindingId}") @Produces(MediaType.TEXT_PLAIN) Response getHaproxyBinding(@Auth final User user,  @PathParam("haproxyId") String haproxyId, @PathParam("bindingId") String bindingId); @GET @Path("{haproxyId}") @Produces(MediaType.APPLICATION_JSON) Response getHaproxy(@Auth final User user, @PathParam("haproxyId") String haproxyId); boolean getHaproxyAndAccepting404(@Auth final User user, @PathParam("haproxyId") String haproxyId); @GET @Produces(MediaType.APPLICATION_JSON) Response getAll(@Auth final User user); @GET @Path("/platforms") @Produces(MediaType.APPLICATION_JSON) Set<String> getPlatforms(@Auth final User user); @GET @Path("/ids") @Produces(MediaType.APPLICATION_JSON) Set<String> getHaproxyIds(@Auth final User user); @POST @Path("/template/valorise") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.TEXT_PLAIN) String getHaproxyConfiguration(@Auth final User user, @NotNull @Valid EntryPointWithPortsMappingJson configuration); @GET @Path("/versions") @Produces(MediaType.APPLICATION_JSON) Set<String> getHaproxyVersions(@Auth final User user); @PUT @Path("/versions/{haproxyVersion}") void addHaproxyVersion(@Auth final User user, @PathParam("haproxyVersion") String haproxyVersion);  }
@Test public void should_get_all_ids(){ Set<String> ids = new HashSet<>(); ids.add("id1"); ids.add("id2"); when(haproxyRepository.getHaproxyIds()).thenReturn(ids); Set<String> result = resources.client().target("/haproxy/ids").request().get(Set.class); assertThat(result, is(ids)); }