@Test(expected = WebApplicationException.class) public void testGetNonExistingUser() throws Exception { doReturn(true).when(userService).isAdmin(); userService.getUser(-1); }
@GET @Path("/users/{userId}") @Produces(MediaType.APPLICATION_JSON) public User getUser(@PathParam("userId") long userId) { return getExistingUser(userId); }
UserService extends BasicService { @GET @Path("/users/{userId}") @Produces(MediaType.APPLICATION_JSON) public User getUser(@PathParam("userId") long userId) { return getExistingUser(userId); } }
UserService extends BasicService { @GET @Path("/users/{userId}") @Produces(MediaType.APPLICATION_JSON) public User getUser(@PathParam("userId") long userId) { return getExistingUser(userId); }  }
UserService extends BasicService { @GET @Path("/users/{userId}") @Produces(MediaType.APPLICATION_JSON) public User getUser(@PathParam("userId") long userId) { return getExistingUser(userId); }  @GET @Path("/user") @Produces(MediaType.APPLICATION_JSON) User getCurrentUser(); @GET @Path("/users/{userId}") @Produces(MediaType.APPLICATION_JSON) User getUser(@PathParam("userId") long userId); @DELETE @Path("/users/{userId}") Response deleteUser(@PathParam("userId") long userId); @POST @Path("/users/{userId}/impersonate") Response impersonateUser(@PathParam("userId") long userId); @POST @Path("/stopimpersonation") Response stopImpersonation(); @POST @Path("/logout") Response logoutCurrentUser(); }
UserService extends BasicService { @GET @Path("/users/{userId}") @Produces(MediaType.APPLICATION_JSON) public User getUser(@PathParam("userId") long userId) { return getExistingUser(userId); }  @GET @Path("/user") @Produces(MediaType.APPLICATION_JSON) User getCurrentUser(); @GET @Path("/users/{userId}") @Produces(MediaType.APPLICATION_JSON) User getUser(@PathParam("userId") long userId); @DELETE @Path("/users/{userId}") Response deleteUser(@PathParam("userId") long userId); @POST @Path("/users/{userId}/impersonate") Response impersonateUser(@PathParam("userId") long userId); @POST @Path("/stopimpersonation") Response stopImpersonation(); @POST @Path("/logout") Response logoutCurrentUser();  }