@@ -60,34 +60,13 @@ public void setUp() {
6060 recruitBoardRepository .saveAll (boards );
6161 }
6262
63- @ DisplayName ("검색 키워드가 포함된 모집글을 조회한다. (service)" )
64- @ Test
65- void getRecruitBoardBySearch () {
66- //given
67- Pageable pageable = getPageable ();
68- RecruitBoardSearchCondition condition = RecruitBoardSearchCondition .builder ()
69- .keyword ("노인" )
70- .pageable (pageable )
71- .build ();
72-
73- //when
74- Page <RecruitBoardWithCenterResponseDto > dtos = recruitBoardDocumentService .getRecruitBoardBySearch (condition );
75-
76- //then
77- assertThat (dtos ).isNotNull ();
78- assertThat (dtos .getContent ()).isNotNull ();
79- assertThat (dtos .getTotalElements ()).isEqualTo (4 );
80- assertThat (dtos .getSize ()).isEqualTo (5 );
81- assertThat (dtos .getTotalPages ()).isEqualTo (1 );
82- }
83-
84- // @DisplayName("키워드 없이 검색시 전체 모집글을 조회한다. (service)")
63+ // @DisplayName("검색 키워드가 포함된 모집글을 조회한다. (service)")
8564// @Test
86- // void getRecruitBoardBySearchWithNull () {
65+ // void getRecruitBoardBySearch () {
8766// //given
8867// Pageable pageable = getPageable();
8968// RecruitBoardSearchCondition condition = RecruitBoardSearchCondition.builder()
90- // .keyword("")
69+ // .keyword("노인 ")
9170// .pageable(pageable)
9271// .build();
9372//
@@ -97,11 +76,32 @@ void getRecruitBoardBySearch() {
9776// //then
9877// assertThat(dtos).isNotNull();
9978// assertThat(dtos.getContent()).isNotNull();
100- // assertThat(dtos.getTotalElements()).isEqualTo(23 );
79+ // assertThat(dtos.getTotalElements()).isEqualTo(4 );
10180// assertThat(dtos.getSize()).isEqualTo(5);
102- // assertThat(dtos.getTotalPages()).isEqualTo(5 );
81+ // assertThat(dtos.getTotalPages()).isEqualTo(1 );
10382// }
10483
84+ @ DisplayName ("키워드 없이 검색시 전체 모집글을 조회한다. (service)" )
85+ @ Test
86+ void getRecruitBoardBySearchWithNull () {
87+ //given
88+ Pageable pageable = getPageable ();
89+ RecruitBoardSearchCondition condition = RecruitBoardSearchCondition .builder ()
90+ .keyword ("" )
91+ .pageable (pageable )
92+ .build ();
93+
94+ //when
95+ Page <RecruitBoardWithCenterResponseDto > dtos = recruitBoardDocumentService .getRecruitBoardBySearch (condition );
96+
97+ //then
98+ assertThat (dtos ).isNotNull ();
99+ assertThat (dtos .getContent ()).isNotNull ();
100+ assertThat (dtos .getTotalElements ()).isEqualTo (30 );
101+ assertThat (dtos .getSize ()).isEqualTo (5 );
102+ assertThat (dtos .getTotalPages ()).isEqualTo (6 );
103+ }
104+
105105// @DisplayName("위치 기반으로 주변 모집글을 페이징하여 조회할 수 있다. (service)")
106106// @Test
107107// void getRecruitBoardsNearBy() {
0 commit comments