### Question:
UserHandler extends Handler { @Doc("Get the user info") @GET @Path("/info") public User info(@LoginUser(required = true) String id) { return em.find(User.class, id); }  @Doc("Sign up a user") @GET @Path("/signup") @HandleErrors({ @HandleError(code = 20000, exception = UsernameDuplicateException.class, description = "Username duplicate") }) User signup(
        @QueryParam("username") @Required String username,
        @QueryParam("password") @Required String password,
        @QueryParam("email") String email
    ); @Doc("User login. Returns the auth token.") @GET @Path("/login") @HandleErrors({ @HandleError(code = 20001, exception = InvalidatePasswordException.class, description = "invalidate password") }) TokenResult login(
        @QueryParam("username") @Required String username,
        @QueryParam("password") @Required String password
    ); @Doc("Get the user info") @GET @Path("/info") User info(@LoginUser(required = true) String id); @DBSession public EntityManager em; }### Answer:
@Test public void testInfo() throws Exception { UserHandlerTester.signup("user5", "pass5", null, User.class); UserHandler.TokenResult result = UserHandlerTester.login("user5", "pass5", UserHandler.TokenResult.class); User user = UserHandlerTester.info(result.token, User.class); assertEquals("user5", user.username); }
@Test public void testInfoNoAuth() throws Exception { ErrorResult result = UserHandlerTester.info("", ErrorResult.class); assertEquals(403, result.code); }