@Test public void show() { User user = WebClient.create("http: .path("/user/show/" + users.iterator().next().getId()) .get(User.class); assertEquals("foo", user.getFullname()); assertEquals("foopwd", user.getPassword()); assertEquals("foo@foo.com", user.getEmail()); }
@Path("/create") @PUT public User create(@QueryParam("name") String name, @QueryParam("pwd") String pwd, @QueryParam("mail") String mail) { User user = new User(); user.setFullname(name); user.setPassword(pwd); user.setEmail(mail); em.persist(user); return user.copy(); }
UserService { @Path("/create") @PUT public User create(@QueryParam("name") String name, @QueryParam("pwd") String pwd, @QueryParam("mail") String mail) { User user = new User(); user.setFullname(name); user.setPassword(pwd); user.setEmail(mail); em.persist(user); return user.copy(); } }
UserService { @Path("/create") @PUT public User create(@QueryParam("name") String name, @QueryParam("pwd") String pwd, @QueryParam("mail") String mail) { User user = new User(); user.setFullname(name); user.setPassword(pwd); user.setEmail(mail); em.persist(user); return user.copy(); }  }
UserService { @Path("/create") @PUT public User create(@QueryParam("name") String name, @QueryParam("pwd") String pwd, @QueryParam("mail") String mail) { User user = new User(); user.setFullname(name); user.setPassword(pwd); user.setEmail(mail); em.persist(user); return user.copy(); }  @Path("/create") @PUT User create(@QueryParam("name") String name,
                       @QueryParam("pwd") String pwd,
                       @QueryParam("mail") String mail); @Path("/list") @GET List<User> list(@QueryParam("first") @DefaultValue("0") int first,
                           @QueryParam("max") @DefaultValue("20") int max); @Path("/show/{id}") @GET User find(@PathParam("id") long id); @Path("/delete/{id}") @DELETE void delete(@PathParam("id") long id); @Path("/update/{id}") @POST Response update(@PathParam("id") long id,
                           @QueryParam("name") String name,
                           @QueryParam("pwd") String pwd,
                           @QueryParam("mail") String mail); }
UserService { @Path("/create") @PUT public User create(@QueryParam("name") String name, @QueryParam("pwd") String pwd, @QueryParam("mail") String mail) { User user = new User(); user.setFullname(name); user.setPassword(pwd); user.setEmail(mail); em.persist(user); return user.copy(); }  @Path("/create") @PUT User create(@QueryParam("name") String name,
                       @QueryParam("pwd") String pwd,
                       @QueryParam("mail") String mail); @Path("/list") @GET List<User> list(@QueryParam("first") @DefaultValue("0") int first,
                           @QueryParam("max") @DefaultValue("20") int max); @Path("/show/{id}") @GET User find(@PathParam("id") long id); @Path("/delete/{id}") @DELETE void delete(@PathParam("id") long id); @Path("/update/{id}") @POST Response update(@PathParam("id") long id,
                           @QueryParam("name") String name,
                           @QueryParam("pwd") String pwd,
                           @QueryParam("mail") String mail);  }