### Question:
AccessService extends RestService { @POST @Path("/logout") @Produces(MediaType.TEXT_PLAIN) @ApiOperation(value = "logout: disconnects current user from REST server") public Response logout() { logger.trace("logout.enter; cookie: {}", bgAuth); repos.disconnect(getClientId()); NewCookie cookie = new NewCookie(bgAuth, null, 0, false); return Response.ok("OK").cookie(cookie).build(); }  @POST @Path("/login") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.TEXT_PLAIN) @ApiOperation(value = "login: creates new connection to Bagri REST server; requires HTTPS protocol") Response login(@ApiParam(name = "params", value = "set of login parameters in JSON format", 
    	example = "{\"schema\": \"default\", \"user\": \"guest\", \"password\": \"xxxxxxxx\"}") final LoginParams params); @POST @Path("/logout") @Produces(MediaType.TEXT_PLAIN) @ApiOperation(value = "logout: disconnects current user from REST server") Response logout();  }### Answer:
@Test public void testLogout() throws Exception { Response response = target("access/logout").request() .post(null, Response.class); assertEquals(401, response.getStatus()); response = target("access/logout").request() .cookie(bg_cookie, "client-id") .post(null, Response.class); assertEquals(200, response.getStatus()); Cookie cc = response.getCookies().get(bg_cookie); assertNotNull(cc); assertEquals(bg_cookie, cc.getName()); assertTrue(cc.toString().endsWith("Max-Age=0")); }