bugfix for query by author name and favorited username

This commit is contained in:
aisensiy
2017-08-19 09:55:24 +08:00
parent 288f2d4c14
commit 4550e5a3c5
3 changed files with 10 additions and 7 deletions

View File

@@ -107,7 +107,7 @@ public class ArticleQueryServiceTest {
Article anotherArticle = new Article("new article", "desc", "body", new String[]{"test"}, anotherUser.getId());
articleRepository.save(anotherArticle);
ArticleDataList recentArticles = queryService.findRecentArticles(null, user.getId(), null, new Page(), user);
ArticleDataList recentArticles = queryService.findRecentArticles(null, user.getUsername(), null, new Page(), user);
assertThat(recentArticles.getArticleDatas().size(), is(1));
assertThat(recentArticles.getCount(), is(1));
}
@@ -123,7 +123,7 @@ public class ArticleQueryServiceTest {
ArticleFavorite articleFavorite = new ArticleFavorite(article.getId(), anotherUser.getId());
articleFavoriteRepository.save(articleFavorite);
ArticleDataList recentArticles = queryService.findRecentArticles(null, null, anotherUser.getId(), new Page(), anotherUser);
ArticleDataList recentArticles = queryService.findRecentArticles(null, null, anotherUser.getUsername(), new Page(), anotherUser);
assertThat(recentArticles.getArticleDatas().size(), is(1));
assertThat(recentArticles.getCount(), is(1));
ArticleData articleData = recentArticles.getArticleDatas().get(0);