SessionResource { @POST @Path("/logout") public void logout(@Auth AccessToken token) { accessTokenDAO.deleteAccessToken(token.getAccessToken()); } SessionResource(AccessTokenDAO accessTokenDAO, UserDAO userDAO, FailedLoginDAO failedLoginDAO, FacebookClient client, AmazonClient s3); @POST @Path("/login") AccessToken login(LoginCredentials credentials); @POST @Path("/logout") void logout(@Auth AccessToken token); @GET @Path("/currentUser") User currentUser(@Auth AccessToken token); @POST @Path("/fbLogin") AccessToken fbLogin(String fbToken);  }
@Test public void testLogout() throws Exception { rule.getJerseyTest() .target("/session/logout") .request().accept(MediaType.APPLICATION_JSON) .header("Authorization", "Bearer test") .post(Entity.json(null)); verify(accessTokenDao).deleteAccessToken(any()); }