55import static com .example .solidconnection .siteuser .service .MyPageService .NICKNAME_LAST_CHANGE_DATE_FORMAT ;
66import static org .assertj .core .api .Assertions .assertThat ;
77import static org .assertj .core .api .AssertionsForClassTypes .assertThatCode ;
8- import static org .mockito .ArgumentMatchers .argThat ;
98import static org .mockito .BDDMockito .any ;
109import static org .mockito .BDDMockito .eq ;
1110import static org .mockito .BDDMockito .given ;
@@ -75,7 +74,7 @@ void setUp() {
7574 int likedUnivApplyInfoCount = createLikedUnivApplyInfos (user );
7675
7776 // when
78- MyPageResponse response = myPageService .getMyPageInfo (user );
77+ MyPageResponse response = myPageService .getMyPageInfo (user . getId () );
7978
8079 // then
8180 Assertions .assertAll (
@@ -101,7 +100,7 @@ class 프로필_이미지_수정_테스트 {
101100 .willReturn (new UploadedFileUrlResponse (expectedUrl ));
102101
103102 // when
104- myPageService .updateMyPageInfo (user , imageFile , "newNickname" );
103+ myPageService .updateMyPageInfo (user . getId () , imageFile , "newNickname" );
105104
106105 // then
107106 SiteUser updatedUser = siteUserRepository .findById (user .getId ()).get ();
@@ -116,10 +115,10 @@ class 프로필_이미지_수정_테스트 {
116115 .willReturn (new UploadedFileUrlResponse ("newProfileImageUrl" ));
117116
118117 // when
119- myPageService .updateMyPageInfo (user , imageFile , "newNickname" );
118+ myPageService .updateMyPageInfo (user . getId () , imageFile , "newNickname" );
120119
121120 // then
122- then (s3Service ).should (never ()).deleteExProfile (any ());
121+ then (s3Service ).should (never ()).deleteExProfile (user . getId ());
123122 }
124123
125124 @ Test
@@ -131,10 +130,10 @@ class 프로필_이미지_수정_테스트 {
131130 .willReturn (new UploadedFileUrlResponse ("newProfileImageUrl" ));
132131
133132 // when
134- myPageService .updateMyPageInfo (커스텀_프로필_사용자 , imageFile , "newNickname" );
133+ myPageService .updateMyPageInfo (커스텀_프로필_사용자 . getId () , imageFile , "newNickname" );
135134
136135 // then
137- then (s3Service ).should ().deleteExProfile (argThat ( userId -> userId . equals ( 커스텀_프로필_사용자 .getId ()) ));
136+ then (s3Service ).should ().deleteExProfile (커스텀_프로필_사용자 .getId ());
138137 }
139138 }
140139
@@ -154,7 +153,7 @@ void setUp() {
154153 String newNickname = "newNickname" ;
155154
156155 // when
157- myPageService .updateMyPageInfo (user , imageFile , newNickname );
156+ myPageService .updateMyPageInfo (user . getId () , imageFile , newNickname );
158157
159158 // then
160159 SiteUser updatedUser = siteUserRepository .findById (user .getId ()).get ();
@@ -171,7 +170,7 @@ void setUp() {
171170 siteUserRepository .save (user );
172171
173172 // when & then
174- assertThatCode (() -> myPageService .updateMyPageInfo (user , imageFile , "nickname12" ))
173+ assertThatCode (() -> myPageService .updateMyPageInfo (user . getId () , imageFile , "nickname12" ))
175174 .isInstanceOf (CustomException .class )
176175 .hasMessage (createExpectedErrorMessage (modifiedAt ));
177176 }
0 commit comments