### Question:
AuthenticationEndpoint { @PUT @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response userSignIn(@Context ContainerRequestContext context, Credentials credentials) { try{ Credentials dbCreds = authServerLogic.userSignIn(credentials); context.setSecurityContext(new UserContext(context.getUriInfo(),dbCreds)); logger.info("Login Successful. Returning: " + dbCreds); return ok(dbCreds); }catch (ServerDAO.DAOException e) { logger.severe(ExceptionUtils.getStackTrace(e)); return fromDAOExpection(e); } catch (Exception e) { logger.severe(ExceptionUtils.getStackTrace(e)); return Response.serverError().build(); } }  @PostConstruct void init(); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response userSignUp(@Context ContainerRequestContext context, Credentials credentials); @PUT @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response userSignIn(@Context ContainerRequestContext context, Credentials credentials); @GET @Path("/key") @Produces(MediaType.APPLICATION_JSON) Response getPublicKey(); @GET @Path("/validate/{token}") @Produces(MediaType.APPLICATION_JSON) Response validateAccount(@PathParam("token") String token); @GET @Path("/from/{token}") @Produces(MediaType.APPLICATION_JSON) Response getUserFromToken(@Context ContainerRequestContext context, @PathParam("token") String token); @GET @Path("/recover/{token}") @Produces(MediaType.APPLICATION_JSON) Response recoverFromOneTimeToken(@Context ContainerRequestContext context, @PathParam("token") String token); @POST @Path("/user/data/{userId}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response recieveUserData(@Context Session session, @PathParam("userId") String userId, Map<String,?> data); @PUT @Path("/user/data/{userId}") @Produces(MediaType.APPLICATION_JSON) Response sendUserData(@Context Session session, @PathParam("userId") String userId);  }### Answer:
@Test public void testUserSignIn() throws Exception { Credentials user = signUpUser(this); System.out.println("User1:" + TestUtils.getTestUser()); user.setPassword(TestUtils.getTestUser().getPassword()); user.encryptPassword(getPublicKey(this)); target("/auth").request().put(TestUtils.toEntity(user), String.class); }