@@ -967,13 +967,15 @@ void temporarySaveExistingLetter_success() throws Exception {
967967 // given
968968 Long letterId = 1L ;
969969 Long writerId = 1L ;
970+ Long matchingId = 1L ;
970971
971972 // Letter를 mock으로 생성
972973 Letter existingLetter = mock (Letter .class );
973974 // mock 객체에 필요한 getter 메서드 동작 정의
974975 when (existingLetter .getId ()).thenReturn (letterId );
975976 when (existingLetter .getTitle ()).thenReturn ("임시 저장 제목" );
976977 when (existingLetter .getContent ()).thenReturn ("임시 저장 내용" );
978+ when (existingLetter .getMatchingId ()).thenReturn (matchingId );
977979 when (existingLetter .getCategory ()).thenReturn (Category .ETC );
978980 when (existingLetter .getFontType ()).thenReturn (FontType .HIMCHAN );
979981 when (existingLetter .getPaperType ()).thenReturn (PaperType .COMFORT );
@@ -987,6 +989,7 @@ void temporarySaveExistingLetter_success() throws Exception {
987989 Field fontField = TemporarySaveLetterRequest .class .getDeclaredField ("fontType" );
988990 Field paperTypeField = TemporarySaveLetterRequest .class .getDeclaredField ("paperType" );
989991 Field receiverIdField = TemporarySaveLetterRequest .class .getDeclaredField ("receiverId" );
992+ Field matchingIdField = TemporarySaveLetterRequest .class .getDeclaredField ("matchingId" );
990993 Field parentLetterIdField = TemporarySaveLetterRequest .class .getDeclaredField ("parentLetterId" );
991994
992995 titleField .setAccessible (true );
@@ -995,6 +998,7 @@ void temporarySaveExistingLetter_success() throws Exception {
995998 fontField .setAccessible (true );
996999 paperTypeField .setAccessible (true );
9971000 receiverIdField .setAccessible (true );
1001+ matchingIdField .setAccessible (true );
9981002 parentLetterIdField .setAccessible (true );
9991003
10001004 titleField .set (request , "임시 저장 제목" );
@@ -1003,6 +1007,7 @@ void temporarySaveExistingLetter_success() throws Exception {
10031007 fontField .set (request , FontType .HIMCHAN );
10041008 paperTypeField .set (request , PaperType .COMFORT );
10051009 receiverIdField .set (request , null );
1010+ matchingIdField .set (request , matchingId );
10061011 parentLetterIdField .set (request , null );
10071012
10081013 // 서비스 메서드 모킹
@@ -1013,6 +1018,7 @@ void temporarySaveExistingLetter_success() throws Exception {
10131018 // void 메서드 모킹 (doNothing 사용)
10141019 doNothing ().when (existingLetter ).updateTemporarySave (
10151020 request .getReceiverId (),
1021+ request .getMatchingId (),
10161022 request .getParentLetterId (),
10171023 request .getCategory (),
10181024 request .getTitle (),
@@ -1028,6 +1034,7 @@ void temporarySaveExistingLetter_success() throws Exception {
10281034 () -> assertEquals (letterId , response .getLetterId ()),
10291035 () -> assertEquals ("임시 저장 제목" , response .getTitle ()),
10301036 () -> assertEquals ("임시 저장 내용" , response .getContent ()),
1037+ () -> assertEquals (matchingId , response .getMatchingId ()),
10311038 () -> assertEquals (Category .ETC , response .getCategory ()),
10321039 () -> assertEquals (FontType .HIMCHAN , response .getFontType ()),
10331040 () -> assertEquals (PaperType .COMFORT , response .getPaperType ()),
@@ -1038,6 +1045,7 @@ void temporarySaveExistingLetter_success() throws Exception {
10381045 verify (letterRepository ).findByIdAndWriterId (letterId , writerId );
10391046 verify (existingLetter ).updateTemporarySave (
10401047 request .getReceiverId (),
1048+ request .getMatchingId (),
10411049 request .getParentLetterId (),
10421050 request .getCategory (),
10431051 request .getTitle (),
0 commit comments