Ejemplo n.º 1
0
 @Test
 public void updateArticle() {
   Article article = new Article();
   article.setContext("妞晚安");
   article.setId(1);
   article.setStatus(1);
   article.setComment_number(1);
   articleService.updateArticle(article);
 }
Ejemplo n.º 2
0
 @Test
 public void addArticle() {
   Article article = new Article();
   Category category = new Category();
   category.setId(1);
   article.setStatus(1);
   article.setCategory(category);
   article.setTitle("测试标题啊1");
   article.setContext("添加一个测试数据");
   article.setCreate_time(new Date());
   User user = new User();
   user.setId(1);
   article.setUser(user);
   boolean flag = articleService.addArticle(article);
   System.out.println(flag);
 }
Ejemplo n.º 3
0
 @Test
 public void getArticleList() {
   List<Article> articles = articleService.getArticleList(1, 10);
   List<Article> articleList = articleService.getArticleList();
   for (Article article : articles) System.out.println(article.toString());
 }
Ejemplo n.º 4
0
 @Test
 public void getArticle() {
   Article article = articleService.getArticle(2);
   System.out.println(article.toString());
 }