Skip to content

Commit

Permalink
[#93] test: PostViewStatisticDaoTest 테스트 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
shin-mallang committed Nov 28, 2023
1 parent ceb5c8e commit 47c59ae
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
import static com.mallang.statistics.api.query.PeriodType.WEEK;
import static com.mallang.statistics.api.query.PeriodType.YEAR;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import com.mallang.common.ServiceTest;
import com.mallang.post.domain.PostId;
import com.mallang.post.exception.NotFoundPostException;
import com.mallang.statistics.api.query.StatisticCondition;
import com.mallang.statistics.api.query.response.PostViewStatisticResponse;
import com.mallang.statistics.statistic.PostViewStatistic;
Expand Down Expand Up @@ -95,6 +97,17 @@ void setUp() {
));
}

@Test
void 자신의_포스트가_아닌_경우_예외() {
// given
StatisticCondition cond = new StatisticCondition(DAY, 날짜_2023_11_25_토, 날짜_2023_11_25_토);

// when & then
assertThatThrownBy(() -> {
postViewStatisticDao.find(memberId + 1L, blogName, postId.getId(), cond);
}).isInstanceOf(NotFoundPostException.class);
}

@Test
void 일간_조회수_통계를_구한다() {
// given
Expand Down

0 comments on commit 47c59ae

Please sign in to comment.