@Test @RunAsClient public void testUpdate() { final Speaker search = new Speaker(); search.setNameFirst("Charlie"); search.setNameLast("Hunt"); final Set<Speaker> speakers = this.getWebTarget("speaker/search").request(MediaType.APPLICATION_JSON_TYPE) .put(Entity.json(search)) .readEntity(new GenericType<Set<Speaker>>() { }); final Speaker found = speakers.iterator().next(); final String id = found.getId(); Assert.assertEquals("Oracle", found.getOrganization()); found.setOrganization("Oracle Corporation"); this.getWebTarget("speaker/update").request(MediaType.APPLICATION_JSON_TYPE) .put(Entity.json(found)); final Speaker updated = this.getWebTarget("speaker/retrieve/{id}").resolveTemplate("id", id) .request(MediaType.APPLICATION_JSON_TYPE) .get() .readEntity(Speaker.class); Assert.assertEquals("Failed to update speaker", "Oracle Corporation", updated.getOrganization()); this.log.info("Updated: " + updated.toString()); }
@PUT @Path("/update") public Speaker update(final Speaker speaker) { return this.addHyperMedia(this.speakerDAO.update(speaker)); }
ResourceSpeaker { @PUT @Path("/update") public Speaker update(final Speaker speaker) { return this.addHyperMedia(this.speakerDAO.update(speaker)); } }
ResourceSpeaker { @PUT @Path("/update") public Speaker update(final Speaker speaker) { return this.addHyperMedia(this.speakerDAO.update(speaker)); }  }
ResourceSpeaker { @PUT @Path("/update") public Speaker update(final Speaker speaker) { return this.addHyperMedia(this.speakerDAO.update(speaker)); }  @GET Collection<Speaker> retrieveAll(); @GET @Path("/nessProbe") @Produces(MediaType.TEXT_PLAIN) Response nessProbe(); @POST @Path("/add") Speaker add(final Speaker speaker); @DELETE @Path("/remove/{id}") void remove(@PathParam("id") final String id); @PUT @Path("/update") Speaker update(final Speaker speaker); @GET @Path("/retrieve/{id}") Speaker retrieve(@PathParam("id") final String id); @PUT @Path("/search") Set<Speaker> search(final Speaker speaker); }
ResourceSpeaker { @PUT @Path("/update") public Speaker update(final Speaker speaker) { return this.addHyperMedia(this.speakerDAO.update(speaker)); }  @GET Collection<Speaker> retrieveAll(); @GET @Path("/nessProbe") @Produces(MediaType.TEXT_PLAIN) Response nessProbe(); @POST @Path("/add") Speaker add(final Speaker speaker); @DELETE @Path("/remove/{id}") void remove(@PathParam("id") final String id); @PUT @Path("/update") Speaker update(final Speaker speaker); @GET @Path("/retrieve/{id}") Speaker retrieve(@PathParam("id") final String id); @PUT @Path("/search") Set<Speaker> search(final Speaker speaker);  }