1919import static com .example .solidconnection .common .exception .ErrorCode .ALREADY_LIKED_UNIVERSITY ;
2020import static com .example .solidconnection .common .exception .ErrorCode .NOT_LIKED_UNIVERSITY ;
2121import static com .example .solidconnection .common .exception .ErrorCode .UNIVERSITY_INFO_FOR_APPLY_NOT_FOUND ;
22- import static com .example .solidconnection .university .service .UniversityLikeService .LIKE_CANCELED_MESSAGE ;
23- import static com .example .solidconnection .university .service .UniversityLikeService .LIKE_SUCCESS_MESSAGE ;
22+ import static com .example .solidconnection .university .service .UnivApplyInfoLikeService .LIKE_CANCELED_MESSAGE ;
23+ import static com .example .solidconnection .university .service .UnivApplyInfoLikeService .LIKE_SUCCESS_MESSAGE ;
2424import static org .assertj .core .api .Assertions .assertThat ;
2525import static org .assertj .core .api .AssertionsForClassTypes .assertThatCode ;
2626import static org .junit .jupiter .api .Assertions .assertAll ;
2727
2828@ TestContainerSpringBootTest
2929@ DisplayName ("대학교 좋아요 서비스 테스트" )
30- class UniversityLikeServiceTest {
30+ class UnivApplyInfoLikeServiceTest {
3131
3232 @ Autowired
33- private UniversityLikeService universityLikeService ;
33+ private UnivApplyInfoLikeService univApplyInfoLikeService ;
3434
3535 @ Autowired
3636 private LikedUniversityRepository likedUniversityRepository ;
@@ -56,7 +56,7 @@ class 대학_좋아요를_등록한다 {
5656 @ Test
5757 void 성공적으로_좋아요를_등록한다 () {
5858 // when
59- LikeResultResponse response = universityLikeService . likeUniversity (user , 괌대학_A_지원_정보 .getId ());
59+ LikeResultResponse response = univApplyInfoLikeService . likeUnivApplyInfo (user , 괌대학_A_지원_정보 .getId ());
6060
6161 // then
6262 assertAll (
@@ -73,7 +73,7 @@ class 대학_좋아요를_등록한다 {
7373 saveLikedUniversity (user , 괌대학_A_지원_정보 );
7474
7575 // when & then
76- assertThatCode (() -> universityLikeService . likeUniversity (user , 괌대학_A_지원_정보 .getId ()))
76+ assertThatCode (() -> univApplyInfoLikeService . likeUnivApplyInfo (user , 괌대학_A_지원_정보 .getId ()))
7777 .isInstanceOf (CustomException .class )
7878 .hasMessage (ALREADY_LIKED_UNIVERSITY .getMessage ());
7979 }
@@ -88,7 +88,7 @@ class 대학_좋아요를_취소한다 {
8888 saveLikedUniversity (user , 괌대학_A_지원_정보 );
8989
9090 // when
91- LikeResultResponse response = universityLikeService . cancelLikeUniversity (user , 괌대학_A_지원_정보 .getId ());
91+ LikeResultResponse response = univApplyInfoLikeService . cancelLikeUnivApplyInfo (user , 괌대학_A_지원_정보 .getId ());
9292
9393 // then
9494 assertAll (
@@ -102,7 +102,7 @@ class 대학_좋아요를_취소한다 {
102102 @ Test
103103 void 좋아요하지_않은_대학이면_예외_응답을_반환한다 () {
104104 // when & then
105- assertThatCode (() -> universityLikeService . cancelLikeUniversity (user , 괌대학_A_지원_정보 .getId ()))
105+ assertThatCode (() -> univApplyInfoLikeService . cancelLikeUnivApplyInfo (user , 괌대학_A_지원_정보 .getId ()))
106106 .isInstanceOf (CustomException .class )
107107 .hasMessage (NOT_LIKED_UNIVERSITY .getMessage ());
108108 }
@@ -111,10 +111,10 @@ class 대학_좋아요를_취소한다 {
111111 @ Test
112112 void 존재하지_않는_대학_좋아요_시도하면_예외_응답을_반환한다 () {
113113 // given
114- Long invalidUniversityId = 9999L ;
114+ Long invalidUnivApplyInfoId = 9999L ;
115115
116116 // when & then
117- assertThatCode (() -> universityLikeService . likeUniversity (user , invalidUniversityId ))
117+ assertThatCode (() -> univApplyInfoLikeService . likeUnivApplyInfo (user , invalidUnivApplyInfoId ))
118118 .isInstanceOf (CustomException .class )
119119 .hasMessage (UNIVERSITY_INFO_FOR_APPLY_NOT_FOUND .getMessage ());
120120 }
@@ -125,7 +125,7 @@ class 대학_좋아요를_취소한다 {
125125 saveLikedUniversity (user , 괌대학_A_지원_정보 );
126126
127127 // when
128- IsLikeResponse response = universityLikeService .getIsLiked (user , 괌대학_A_지원_정보 .getId ());
128+ IsLikeResponse response = univApplyInfoLikeService .getIsLiked (user , 괌대학_A_지원_정보 .getId ());
129129
130130 // then
131131 assertThat (response .isLike ()).isTrue ();
@@ -134,7 +134,7 @@ class 대학_좋아요를_취소한다 {
134134 @ Test
135135 void 좋아요하지_않은_대학인지_확인한다 () {
136136 // when
137- IsLikeResponse response = universityLikeService .getIsLiked (user , 괌대학_A_지원_정보 .getId ());
137+ IsLikeResponse response = univApplyInfoLikeService .getIsLiked (user , 괌대학_A_지원_정보 .getId ());
138138
139139 // then
140140 assertThat (response .isLike ()).isFalse ();
@@ -143,10 +143,10 @@ class 대학_좋아요를_취소한다 {
143143 @ Test
144144 void 존재하지_않는_대학의_좋아요_여부를_조회하면_예외_응답을_반환한다 () {
145145 // given
146- Long invalidUniversityId = 9999L ;
146+ Long invalidUnivApplyInfoId = 9999L ;
147147
148148 // when & then
149- assertThatCode (() -> universityLikeService .getIsLiked (user , invalidUniversityId ))
149+ assertThatCode (() -> univApplyInfoLikeService .getIsLiked (user , invalidUnivApplyInfoId ))
150150 .isInstanceOf (CustomException .class )
151151 .hasMessage (UNIVERSITY_INFO_FOR_APPLY_NOT_FOUND .getMessage ());
152152 }
0 commit comments