@Test public void create() { WebClient.create("http: .path("/user/create") .query("name", "dummy") .query("pwd", "unbreakable") .query("mail", "foo@bar.fr") .put("{}"); List<User> list = service.list(0, 100); for (User u : list) { if (!users.contains(u)) { service.delete(u.getId()); return; } } fail("user was not added"); }
@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);  }