### Question:
ArticleHandler extends Handler { @PUT @Path("/") @Doc("Create an article") public Article createArticle( @FormParam("title") @Required String title, @FormParam("content") @EscapeHTML @Required String content ) { Article article = new Article(); article.author = em.find(User.class, userId); article.title = title; article.content = content; em.persist(article); return article; }  @PUT @Path("/") @Doc("Create an article") Article createArticle(
        @FormParam("title") @Required String title,
        @FormParam("content") @EscapeHTML @Required String content
    ); @HandleErrors({ @HandleError(code = 20010, exception = ObjectNotFoundException.class, description = "article not found") }) @GET @Path("/{id}") @Doc("Get an article by id") Article getArticle(@PathParam("id") @Required String articleId); @DBSession public EntityManager em; @LoginUser(required = true) public String userId; }### Answer:
@Test public void testCreateArticle() throws Exception { User user = UserHandlerTester.signup("article-user-1", "article-pass-1", null, User.class); UserHandler.TokenResult token = UserHandlerTester.login("article-user-1", "article-pass-1", UserHandler.TokenResult.class); Article article = ArticleHandlerTester.createArticle(token.token, "title", "content", Article.class); assertNotNull(article.id); assertEquals(user.username, article.author.username); assertEquals("title", article.title); assertEquals("content", article.content); }