File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
backend/src/test/java/com/ai/lawyer/domain/poll Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 1919import jakarta .servlet .http .Cookie ;
2020import static org .mockito .BDDMockito .*;
2121import com .ai .lawyer .global .jwt .TokenProvider ;
22+ import com .ai .lawyer .domain .poll .dto .PollStaticsResponseDto ;
2223
2324@ Import (SecurityConfig .class )
2425@ AutoConfigureMockMvc
@@ -92,7 +93,7 @@ void t3() throws Exception {
9293 @ Test
9394 @ DisplayName ("투표 통계 조회" )
9495 void t4 () throws Exception {
95- Mockito .when (pollService .getPollStatics (Mockito .anyLong ())).thenReturn (java . util . Collections . emptyList ());
96+ Mockito .when (pollService .getPollStatics (Mockito .anyLong ())).thenReturn (new PollStaticsResponseDto ());
9697
9798 mockMvc .perform (get ("/api/polls/1/statics" )
9899 .cookie (new Cookie ("accessToken" , "valid-access-token" )))
Original file line number Diff line number Diff line change 44import com .ai .lawyer .domain .poll .dto .PollCreateDto ;
55import com .ai .lawyer .domain .poll .dto .PollVoteDto ;
66import com .ai .lawyer .domain .poll .dto .PollUpdateDto ;
7+ import com .ai .lawyer .domain .poll .dto .PollStaticsResponseDto ;
78import org .junit .jupiter .api .BeforeEach ;
89import org .junit .jupiter .api .DisplayName ;
910import org .junit .jupiter .api .Test ;
@@ -54,9 +55,9 @@ void t3() {
5455 @ Test
5556 @ DisplayName ("투표 통계 조회" )
5657 void t4 () {
57- java . util . List expected = java . util . Collections . emptyList ();
58+ PollStaticsResponseDto expected = new PollStaticsResponseDto ();
5859 Mockito .when (pollService .getPollStatics (Mockito .anyLong ())).thenReturn (expected );
59- java . util . List result = pollService .getPollStatics (1L );
60+ PollStaticsResponseDto result = pollService .getPollStatics (1L );
6061 assertThat (result ).isEqualTo (expected );
6162 }
6263
You can’t perform that action at this time.
0 commit comments