### Question:
AccessService extends RestService { @POST @Path("/login") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.TEXT_PLAIN) @ApiOperation(value = "login: creates new connection to Bagri REST server; requires HTTPS protocol") public Response login(@ApiParam(name = "params", value = "set of login parameters in JSON format", example = "{\"schema\": \"default\", \"user\": \"guest\", \"password\": \"xxxxxxxx\"}") final LoginParams params) { logger.debug("login.enter; got params: {}", params); if (repos.getSchema(params.schemaName) == null) { return Response.status(Status.NOT_FOUND).entity("Unknown schema provided").build(); } else { try { SchemaRepository repo = repos.connect(params.schemaName, params.userName, params.password); if (repo != null) { NewCookie cookie = new NewCookie(bg_cookie, repo.getClientId()); server.reload(params.schemaName, false); logger.trace("login.exit; returning client: {}", repo.getClientId()); return Response.ok("OK").cookie(cookie).build(); } else { return Response.status(Status.GONE).entity("Schema is not active").build(); } } catch (Exception ex) { return Response.serverError().entity(ex.getMessage()).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 testLogin() throws Exception { LoginParams params = new LoginParams("default", "guest", "password"); Response response = target("access/login").request() .header("Content-Type", "application/json") .post(Entity.json(params), Response.class); assertEquals(Status.NOT_ACCEPTABLE.getStatusCode(), response.getStatus()); }