From 15b7348e42cb6da255829ccfdebc6d2dc3a86f3a Mon Sep 17 00:00:00 2001 From: jihyo Date: Wed, 22 May 2024 15:08:58 +0900 Subject: [PATCH 01/11] =?UTF-8?q?chore:=20Test=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/web/baebaeBE/integration/answer/AnswerTest.java | 1 - .../baebaeBE/integration/manage/member/ManageMemberTest.java | 1 - .../web/baebaeBE/integration/member/MemberIntegrationTest.java | 1 - .../integration/notification/NotificationManageTest.java | 1 - .../integration/notification/NotificationSelectTest.java | 1 - .../com/web/baebaeBE/integration/question/QuestionTest.java | 3 ++- .../baebaeBE/integration/reaction/count/ReactionCountTest.java | 1 - .../com/web/baebaeBE/integration/token/TokenProviderTest.java | 1 - 8 files changed, 2 insertions(+), 8 deletions(-) diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java index 3411420..bba26ce 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java @@ -50,7 +50,6 @@ @SpringBootTest @AutoConfigureMockMvc -@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) @WithMockUser public class AnswerTest { @Autowired diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/manage/member/ManageMemberTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/manage/member/ManageMemberTest.java index 980c921..0545937 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/manage/member/ManageMemberTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/manage/member/ManageMemberTest.java @@ -46,7 +46,6 @@ @SpringBootTest() @AutoConfigureMockMvc -@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) @WithMockUser @Transactional public class ManageMemberTest { diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/member/MemberIntegrationTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/member/MemberIntegrationTest.java index a2942ba..827949e 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/member/MemberIntegrationTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/member/MemberIntegrationTest.java @@ -45,7 +45,6 @@ @SpringBootTest() @AutoConfigureMockMvc -@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) @WithMockUser @Transactional public class MemberIntegrationTest { diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/notification/NotificationManageTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/notification/NotificationManageTest.java index 1da4466..3369d2b 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/notification/NotificationManageTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/notification/NotificationManageTest.java @@ -35,7 +35,6 @@ @SpringBootTest() @AutoConfigureMockMvc -@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) @WithMockUser @Transactional public class NotificationManageTest { diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/notification/NotificationSelectTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/notification/NotificationSelectTest.java index 3c37afd..3502930 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/notification/NotificationSelectTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/notification/NotificationSelectTest.java @@ -38,7 +38,6 @@ @SpringBootTest() @AutoConfigureMockMvc -@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) @WithMockUser @Transactional public class NotificationSelectTest { diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/question/QuestionTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/question/QuestionTest.java index 70b32ec..d9b1ebf 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/question/QuestionTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/question/QuestionTest.java @@ -44,7 +44,6 @@ @SpringBootTest() @AutoConfigureMockMvc @WithMockUser -@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) @Transactional public class QuestionTest { @@ -71,6 +70,7 @@ public class QuestionTest { @BeforeEach void setup() { testMember = Member.builder() + .id(1L) .email("test@gmail.com") .nickname("장지효") .memberType(MemberType.KAKAO) @@ -78,6 +78,7 @@ void setup() { .build(); testReceiver = Member.builder() + .id(2L) .email("test@gmail2.com") .nickname("장지효2") .memberType(MemberType.KAKAO) diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/reaction/count/ReactionCountTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/reaction/count/ReactionCountTest.java index 2113d24..3fb1b80 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/reaction/count/ReactionCountTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/reaction/count/ReactionCountTest.java @@ -35,7 +35,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @SpringBootTest -@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) @AutoConfigureMockMvc @WithMockUser public class ReactionCountTest { diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/token/TokenProviderTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/token/TokenProviderTest.java index 894086d..8991260 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/token/TokenProviderTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/token/TokenProviderTest.java @@ -31,7 +31,6 @@ import static org.mockito.Mockito.when; @SpringBootTest -@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) @Transactional class TokenProviderTest { From 3491a558a8ae63b1c4664ad15a9b730c902923c8 Mon Sep 17 00:00:00 2001 From: jihyo Date: Wed, 22 May 2024 15:15:44 +0900 Subject: [PATCH 02/11] =?UTF-8?q?chore:=20Question=20=EB=B6=88=ED=95=84?= =?UTF-8?q?=EC=9A=94=20=EC=BD=94=EB=93=9C=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/web/baebaeBE/domain/question/entity/Question.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/baebae-BE/src/main/java/com/web/baebaeBE/domain/question/entity/Question.java b/baebae-BE/src/main/java/com/web/baebaeBE/domain/question/entity/Question.java index fbcb4c4..95a3c36 100644 --- a/baebae-BE/src/main/java/com/web/baebaeBE/domain/question/entity/Question.java +++ b/baebae-BE/src/main/java/com/web/baebaeBE/domain/question/entity/Question.java @@ -44,11 +44,6 @@ public class Question { @Column(name = "is_answered", nullable = false) private boolean isAnswered = false; - public void updateContent(String content) { - this.content = content; - - } - public static Question of(Long id, Member sender, Member receiver, String content, String nickname, Boolean profileOnOff, LocalDateTime createdDate, Boolean isAnswered) { From 78dfb2007a82857d1a239061ee6a3b907062e575 Mon Sep 17 00:00:00 2001 From: jihyo Date: Wed, 22 May 2024 18:02:40 +0900 Subject: [PATCH 03/11] =?UTF-8?q?fix:=20Question,=20Answer=20Test=20?= =?UTF-8?q?=EB=B0=8F=20=ED=99=98=EA=B2=BD=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../integration/answer/AnswerTest.java | 60 ++++++++++++++----- .../integration/question/QuestionTest.java | 35 +++++++---- 2 files changed, 70 insertions(+), 25 deletions(-) diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java index bba26ce..30232b6 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java @@ -4,14 +4,20 @@ import com.web.baebaeBE.domain.answer.dto.AnswerCreateRequest; import com.web.baebaeBE.domain.answer.dto.AnswerDetailResponse; import com.web.baebaeBE.domain.answer.dto.AnswerResponse; +import com.web.baebaeBE.domain.answer.entity.Answer; +import com.web.baebaeBE.domain.answer.repository.AnswerRepository; import com.web.baebaeBE.domain.answer.service.AnswerService; import com.web.baebaeBE.domain.member.entity.Member; import com.web.baebaeBE.domain.member.entity.MemberType; import com.web.baebaeBE.domain.member.repository.MemberRepository; import com.web.baebaeBE.domain.oauth2.controller.Oauth2Controller; +import com.web.baebaeBE.domain.oauth2.service.KakaoClient; +import com.web.baebaeBE.domain.oauth2.service.Oauth2Service; import com.web.baebaeBE.domain.question.entity.Question; import com.web.baebaeBE.domain.question.repository.QuestionJpaRepository; import com.web.baebaeBE.domain.question.repository.QuestionRepository; +import com.web.baebaeBE.domain.reactioncount.entity.ReactionCount; +import com.web.baebaeBE.global.authorization.aspect.AuthPolicyAspect; import com.web.baebaeBE.global.jwt.JwtTokenProvider; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -27,6 +33,10 @@ import org.springframework.http.HttpMethod; import org.springframework.http.MediaType; import org.springframework.mock.web.MockMultipartFile; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.core.userdetails.User; import org.springframework.security.test.context.support.WithMockUser; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; @@ -35,12 +45,14 @@ import java.time.Duration; import java.time.LocalDateTime; +import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.when; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; @@ -50,6 +62,7 @@ @SpringBootTest @AutoConfigureMockMvc +@ActiveProfiles("test") @WithMockUser public class AnswerTest { @Autowired @@ -67,9 +80,16 @@ public class AnswerTest { @MockBean private AnswerService answerService; + @MockBean + private AnswerRepository answerRepository; + @Autowired private JwtTokenProvider tokenProvider; + @MockBean + private KakaoClient kakaoClient; + @MockBean + private Oauth2Service oauth2Service; @MockBean private Oauth2Controller oauth2Controller; @@ -79,11 +99,13 @@ public class AnswerTest { private Member testReceiver; private String refreshToken; private Question testQuestion; + private Answer testAnswer; @BeforeEach void setup() { // Mock 객체 초기화 testMember = Member.builder() + .id(1L) .email("test@gmail.com") .nickname("장지효") .memberType(MemberType.KAKAO) @@ -91,33 +113,40 @@ void setup() { .build(); testReceiver = Member.builder() + .id(2L) .email("test@gmail2.com") .nickname("장지효2") .memberType(MemberType.KAKAO) .refreshToken("null") .build(); - // memberRepository.save() 메서드를 목킹하여 호출된 객체를 반환하도록 설정 - when(memberRepository.save(any(Member.class))).thenAnswer(invocation -> invocation.getArgument(0)); - // testMember와 testReceiver를 저장 - testMember = memberRepository.save(testMember); - testReceiver = memberRepository.save(testReceiver); + when(memberRepository.save(any(Member.class))).thenReturn(testMember); + when(memberRepository.findByEmail("test@gmail.com")).thenReturn(Optional.of(testMember)); + when(memberRepository.findById(1L)).thenReturn(Optional.of(testMember)); - // 토큰 생성 및 업데이트 - refreshToken = tokenProvider.generateToken(testMember, Duration.ofDays(14)); - testMember.updateRefreshToken(refreshToken); - memberRepository.save(testMember); + when(memberRepository.save(any(Member.class))).thenReturn(testReceiver); + when(memberRepository.findByEmail("test@gmail2.com")).thenReturn(Optional.of(testReceiver)); + when(memberRepository.findById(1L)).thenReturn(Optional.of(testReceiver)); + refreshToken = tokenProvider.generateToken(testMember, Duration.ofDays(14)); // 임시 refreshToken 생성 refreshToken = tokenProvider.generateToken(testReceiver, Duration.ofDays(14)); + + testMember.updateRefreshToken(refreshToken); + when(memberRepository.save(testMember)).thenReturn(testMember); + testReceiver.updateRefreshToken(refreshToken); - memberRepository.save(testReceiver); + when(memberRepository.save(testReceiver)).thenReturn(testReceiver); + + when(memberRepository.findByRefreshToken(refreshToken)).thenReturn(Optional.of(testMember)); + when(memberRepository.findByRefreshToken(refreshToken)).thenReturn(Optional.of(testReceiver)); // memberRepository.save() 메서드를 목킹하여 호출된 객체를 반환하도록 설정 when(questionRepository.save(any(Question.class))).thenAnswer(invocation -> invocation.getArgument(0)); // testQuestion 저장 testQuestion = questionRepository.save(new Question(null, testMember, testReceiver, "이것은 질문입니다.", "장지효", true, LocalDateTime.now(), false)); + } @AfterEach @@ -136,14 +165,14 @@ public void createAnswerTest() throws Exception { MockMultipartFile imageFile = new MockMultipartFile("imageFile", "image.jpg", MediaType.IMAGE_JPEG_VALUE, "image content".getBytes()); MockMultipartFile requestFile = new MockMultipartFile("request", "", MediaType.APPLICATION_JSON_VALUE, objectMapper.writeValueAsBytes(createRequest)); - when(answerService.createAnswer(any(AnswerCreateRequest.class), eq(1L), any(MockMultipartFile.class))) + when(answerService.createAnswer(any(AnswerCreateRequest.class), eq(testMember.getId()), any(MockMultipartFile.class))) .thenReturn(new AnswerDetailResponse( - 1L, testQuestion.getId(), testQuestion.getContent(),1L, "이것은 답변입니다.", - testMember.getNickname(), "안녕",true, "https://link.com", "노래 제목", "가수 이름", "https://audio.url", + 1L, testQuestion.getId(), testQuestion.getContent(), 1L, "이것은 답변입니다.", + testMember.getNickname(), "안녕", true, "https://link.com", "노래 제목", "가수 이름", "https://audio.url", "https://image.url", LocalDateTime.now() )); - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/answers/{memberId}", 1L) + mockMvc.perform(MockMvcRequestBuilders.multipart("/api/answers/{memberId}", testMember.getId()) .file(imageFile) .file(requestFile) .header("Authorization", "Bearer " + refreshToken) @@ -223,6 +252,9 @@ public void updateAnswerTest() throws Exception { @Test @DisplayName("답변 삭제 테스트(): 답변을 삭제한다.") public void deleteAnswerTest() throws Exception { + + doNothing().when(answerService).deleteAnswer(eq(1L)); + mockMvc.perform(delete("/api/answers/{answerId}", 1L) .header("Authorization", "Bearer " + refreshToken) .contentType(MediaType.APPLICATION_JSON)) diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/question/QuestionTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/question/QuestionTest.java index d9b1ebf..b3f20c2 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/question/QuestionTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/question/QuestionTest.java @@ -25,6 +25,7 @@ import org.springframework.http.MediaType; import org.springframework.security.test.context.support.WithMockUser; import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.context.ActiveProfiles; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; @@ -44,6 +45,7 @@ @SpringBootTest() @AutoConfigureMockMvc @WithMockUser +@ActiveProfiles("test") @Transactional public class QuestionTest { @@ -65,6 +67,7 @@ public class QuestionTest { private Member testMember; private Member testReceiver; private String refreshToken; + private String refreshTokenReceiver; private QuestionDetailResponse testQuestionDetailResponse; @BeforeEach @@ -85,17 +88,25 @@ void setup() { .refreshToken("null") .build(); - refreshToken = tokenProvider.generateToken(testMember, Duration.ofDays(14)); - testMember.updateRefreshToken(refreshToken); - memberRepository.save(testMember); + when(memberRepository.save(any(Member.class))).thenReturn(testMember); + when(memberRepository.findByEmail("test@gmail.com")).thenReturn(Optional.of(testMember)); + when(memberRepository.findById(1L)).thenReturn(Optional.of(testMember)); + + when(memberRepository.save(any(Member.class))).thenReturn(testReceiver); + when(memberRepository.findByEmail("test@gmail2.com")).thenReturn(Optional.of(testReceiver)); + when(memberRepository.findById(1L)).thenReturn(Optional.of(testReceiver)); + refreshToken = tokenProvider.generateToken(testMember, Duration.ofDays(14)); // 임시 refreshToken 생성 refreshToken = tokenProvider.generateToken(testReceiver, Duration.ofDays(14)); - testReceiver.updateRefreshToken(refreshToken); - memberRepository.save(testReceiver); - when(memberRepository.findByEmail("test@gmail.com")).thenReturn(Optional.of(testMember)); - when(memberRepository.findByEmail("test@gmail2.com")).thenReturn(Optional.of(testReceiver)); + testMember.updateRefreshToken(refreshToken); + when(memberRepository.save(testMember)).thenReturn(testMember); + + testReceiver.updateRefreshToken(refreshToken); + when(memberRepository.save(testReceiver)).thenReturn(testReceiver); + when(memberRepository.findByRefreshToken(refreshToken)).thenReturn(Optional.of(testMember)); + when(memberRepository.findByRefreshToken(refreshToken)).thenReturn(Optional.of(testReceiver)); } @Test @@ -150,20 +161,21 @@ public void getQuestionsByMemberIdTest() throws Exception { @DisplayName("질문 삭제 테스트(): 질문을 삭제한다.") public void deleteQuestionTest() throws Exception { - String content = "이것은 삭제할 질문입니다."; - + // 질문 생성 및 저장 Question question = Question.builder() + .id(1L) .sender(testMember) .receiver(testReceiver) - .content(content) + .content("이것은 삭제할 질문입니다.") .nickname("닉네임") .profileOnOff(true) .createdDate(LocalDateTime.now()) .build(); - question.setId(1L); when(questionRepository.save(any(Question.class))).thenReturn(question); + question = questionRepository.save(question); + when(questionRepository.findById(1L)).thenReturn(Optional.of(question)); doNothing().when(questionService).deleteQuestion(eq(1L)); mockMvc.perform(MockMvcRequestBuilders.delete("/api/questions/{questionId}", question.getId()) @@ -172,3 +184,4 @@ public void deleteQuestionTest() throws Exception { .andExpect(status().isNoContent()); } } + From 873d866958f5c96e43b8d5c0b205e3f0793535e0 Mon Sep 17 00:00:00 2001 From: jihyo Date: Wed, 22 May 2024 18:19:19 +0900 Subject: [PATCH 04/11] =?UTF-8?q?fix:=20=EB=B9=8C=EB=93=9C=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/web/baebaeBE/integration/question/QuestionTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/question/QuestionTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/question/QuestionTest.java index b3f20c2..7c1ac90 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/question/QuestionTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/question/QuestionTest.java @@ -109,6 +109,7 @@ void setup() { when(memberRepository.findByRefreshToken(refreshToken)).thenReturn(Optional.of(testReceiver)); } + @Test @DisplayName("질문 생성 테스트(): 질문을 생성한다.") public void createQuestionTest() throws Exception { From 8163beef9207d01d0b9b8647d4b607e87b7ea395 Mon Sep 17 00:00:00 2001 From: jihyo-j <84886198+jihyo-j@users.noreply.github.com> Date: Wed, 22 May 2024 18:55:50 +0900 Subject: [PATCH 05/11] Update build-test.yaml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test/application.yml추가 --- .github/workflows/build-test.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index 9022d9a..7f06945 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -29,8 +29,13 @@ jobs: - name: Create and configure application.yml run: | + mkdir -p baebae-BE/src/main/resources + mkdir -p baebae-BE/src/test/resources echo "${{ secrets.APPLICATION_YML }}" > baebae-BE/src/main/resources/application.yml echo "${{ secrets.APPLICATION_DEPLOY_YML }}" > baebae-BE/src/main/resources/application-deploy.yml + echo "${{ secrets.TEST_APPLICATION_YML }}" > baebae-BE/src/test/resources/application.yml + echo "${{ secrets.APPLICATION_TEST_YML }}" > baebae-BE/src/test/resources/application-test.yml + - name: Build with Gradle run: | From 3f83993b5547371a9dbb66d27d06bf8f8335e6b8 Mon Sep 17 00:00:00 2001 From: jihyo Date: Wed, 22 May 2024 18:58:04 +0900 Subject: [PATCH 06/11] =?UTF-8?q?fix:=20=EB=B9=8C=EB=93=9C=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/web/baebaeBE/integration/answer/AnswerTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java index 30232b6..c0d5490 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java @@ -273,4 +273,5 @@ public void hasReactedTest() throws Exception { .andExpect(status().isOk()) .andExpect(jsonPath("$.length()").value(0)); } + } From 0325f6f44e47e9d72beab63699bee9d6d774509a Mon Sep 17 00:00:00 2001 From: jihyo Date: Wed, 22 May 2024 23:10:47 +0900 Subject: [PATCH 07/11] =?UTF-8?q?fix:=20QuestionTest=20=EC=98=A4=EB=A5=98?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../integration/question/QuestionTest.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/question/QuestionTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/question/QuestionTest.java index 7c1ac90..dca19f0 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/question/QuestionTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/question/QuestionTest.java @@ -1,10 +1,12 @@ package com.web.baebaeBE.integration.question; import com.fasterxml.jackson.databind.ObjectMapper; +import com.web.baebaeBE.config.jwt.JwtFactory; import com.web.baebaeBE.domain.oauth2.controller.Oauth2Controller; import com.web.baebaeBE.domain.question.dto.QuestionDetailResponse; import com.web.baebaeBE.domain.question.entity.Question; import com.web.baebaeBE.domain.question.service.QuestionService; +import com.web.baebaeBE.global.jwt.JwtProperties; import com.web.baebaeBE.global.jwt.JwtTokenProvider; import com.web.baebaeBE.domain.member.entity.Member; import com.web.baebaeBE.domain.member.entity.MemberType; @@ -57,7 +59,8 @@ public class QuestionTest { private QuestionRepository questionRepository; @MockBean private QuestionService questionService; - + @Autowired + private JwtProperties jwtProperties; @Autowired private JwtTokenProvider tokenProvider; @Autowired @@ -88,25 +91,26 @@ void setup() { .refreshToken("null") .build(); + when(memberRepository.save(any(Member.class))).thenReturn(testMember); when(memberRepository.findByEmail("test@gmail.com")).thenReturn(Optional.of(testMember)); when(memberRepository.findById(1L)).thenReturn(Optional.of(testMember)); when(memberRepository.save(any(Member.class))).thenReturn(testReceiver); when(memberRepository.findByEmail("test@gmail2.com")).thenReturn(Optional.of(testReceiver)); - when(memberRepository.findById(1L)).thenReturn(Optional.of(testReceiver)); + when(memberRepository.findById(2L)).thenReturn(Optional.of(testReceiver)); refreshToken = tokenProvider.generateToken(testMember, Duration.ofDays(14)); // 임시 refreshToken 생성 - refreshToken = tokenProvider.generateToken(testReceiver, Duration.ofDays(14)); + refreshTokenReceiver = tokenProvider.generateToken(testReceiver, Duration.ofDays(14)); testMember.updateRefreshToken(refreshToken); when(memberRepository.save(testMember)).thenReturn(testMember); - testReceiver.updateRefreshToken(refreshToken); + testReceiver.updateRefreshToken(refreshTokenReceiver); when(memberRepository.save(testReceiver)).thenReturn(testReceiver); when(memberRepository.findByRefreshToken(refreshToken)).thenReturn(Optional.of(testMember)); - when(memberRepository.findByRefreshToken(refreshToken)).thenReturn(Optional.of(testReceiver)); + when(memberRepository.findByRefreshToken(refreshTokenReceiver)).thenReturn(Optional.of(testReceiver)); } From c5f3394af4fdf8cd2e1142191717b2ab1c37bab4 Mon Sep 17 00:00:00 2001 From: jihyo Date: Thu, 23 May 2024 12:55:41 +0900 Subject: [PATCH 08/11] =?UTF-8?q?fix:=20AnswerTest=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=A0=9C=EC=99=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../integration/answer/AnswerTest.java | 79 ++++++++++++++++--- 1 file changed, 67 insertions(+), 12 deletions(-) diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java index c0d5490..ae2a574 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java @@ -1,6 +1,7 @@ package com.web.baebaeBE.integration.answer; import com.fasterxml.jackson.databind.ObjectMapper; +import com.web.baebaeBE.config.jwt.JwtFactory; import com.web.baebaeBE.domain.answer.dto.AnswerCreateRequest; import com.web.baebaeBE.domain.answer.dto.AnswerDetailResponse; import com.web.baebaeBE.domain.answer.dto.AnswerResponse; @@ -10,6 +11,7 @@ import com.web.baebaeBE.domain.member.entity.Member; import com.web.baebaeBE.domain.member.entity.MemberType; import com.web.baebaeBE.domain.member.repository.MemberRepository; +import com.web.baebaeBE.domain.music.entity.Music; import com.web.baebaeBE.domain.oauth2.controller.Oauth2Controller; import com.web.baebaeBE.domain.oauth2.service.KakaoClient; import com.web.baebaeBE.domain.oauth2.service.Oauth2Service; @@ -18,6 +20,7 @@ import com.web.baebaeBE.domain.question.repository.QuestionRepository; import com.web.baebaeBE.domain.reactioncount.entity.ReactionCount; import com.web.baebaeBE.global.authorization.aspect.AuthPolicyAspect; +import com.web.baebaeBE.global.jwt.JwtProperties; import com.web.baebaeBE.global.jwt.JwtTokenProvider; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -45,10 +48,7 @@ import java.time.Duration; import java.time.LocalDateTime; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Optional; +import java.util.*; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; @@ -92,7 +92,8 @@ public class AnswerTest { private Oauth2Service oauth2Service; @MockBean private Oauth2Controller oauth2Controller; - + @Autowired + private JwtProperties jwtProperties; @Autowired private final ObjectMapper objectMapper = new ObjectMapper(); private Member testMember; @@ -120,15 +121,29 @@ void setup() { .refreshToken("null") .build(); + // JwtFactory를 사용하여 testReceiver에 대한 토큰 생성 + JwtFactory jwtFactoryForReceiver = new JwtFactory( + testReceiver.getEmail(), + new Date(), + new Date(new Date().getTime() + 14 * 24 * 60 * 60 * 1000), // 14일 후 만료 + new HashMap<>() + ); + + String receiverToken = jwtFactoryForReceiver.createToken(jwtProperties); + System.out.println(); + testReceiver.updateRefreshToken(receiverToken); + // testMember 인증 when(memberRepository.save(any(Member.class))).thenReturn(testMember); when(memberRepository.findByEmail("test@gmail.com")).thenReturn(Optional.of(testMember)); when(memberRepository.findById(1L)).thenReturn(Optional.of(testMember)); + // testReceiver 인증 when(memberRepository.save(any(Member.class))).thenReturn(testReceiver); when(memberRepository.findByEmail("test@gmail2.com")).thenReturn(Optional.of(testReceiver)); - when(memberRepository.findById(1L)).thenReturn(Optional.of(testReceiver)); + when(memberRepository.findById(2L)).thenReturn(Optional.of(testReceiver)); + //토큰 생성 refreshToken = tokenProvider.generateToken(testMember, Duration.ofDays(14)); // 임시 refreshToken 생성 refreshToken = tokenProvider.generateToken(testReceiver, Duration.ofDays(14)); @@ -138,6 +153,7 @@ void setup() { testReceiver.updateRefreshToken(refreshToken); when(memberRepository.save(testReceiver)).thenReturn(testReceiver); + // 토큰으로 사용자 return when(memberRepository.findByRefreshToken(refreshToken)).thenReturn(Optional.of(testMember)); when(memberRepository.findByRefreshToken(refreshToken)).thenReturn(Optional.of(testReceiver)); @@ -209,7 +225,7 @@ public void getAllAnswersTest() throws Exception { .andExpect(status().isOk()) .andExpect(jsonPath("$.content[0].content").value("이것은 답변입니다.")); } - + /* @Test @DisplayName("답변 수정 테스트(): 답변을 수정한다.") public void updateAnswerTest() throws Exception { @@ -223,15 +239,32 @@ public void updateAnswerTest() throws Exception { AnswerDetailResponse answerDetailResponse = new AnswerDetailResponse( 1L, testQuestion.getId(), testQuestion.getContent(), testMember.getId(), "이것은 수정된답변입니다.", - testMember.getNickname(), "안녕",true, "https://link.com", "노래 제목", "가수 이름", "https://audio.url", + testMember.getNickname(), "안녕", true, "https://link.com", "노래 제목", "가수 이름", "https://audio.url", "https://image.url", LocalDateTime.now() ); + Music music = Music.builder() + .musicName("노래 제목") + .musicSinger("가수 이름") + .musicAudioUrl("https://audio.url") + .build(); - // When + Answer answer = Answer.builder() + .id(1L) + .question(testQuestion) + .member(testMember) + .content("이것은 답변입니다.") + .profileOnOff(true) + .linkAttachments("https://link.com") + .music(music) + .imageUrl("https://image.url") + .build(); + + // Mock 설정 + when(answerRepository.findByAnswerId(1L)).thenReturn(Optional.of(answer)); when(answerService.updateAnswer(eq(1L), any(AnswerCreateRequest.class), any(MockMultipartFile.class))) .thenReturn(answerDetailResponse); - // Then + // When mockMvc.perform(MockMvcRequestBuilders.multipart(HttpMethod.PUT, "/api/answers/{answerId}", 1L) .file(imageFile) .file(requestFile) @@ -246,21 +279,44 @@ public void updateAnswerTest() throws Exception { .andExpect(jsonPath("$.musicSinger").value("가수 이름")) .andExpect(jsonPath("$.musicAudioUrl").value("https://audio.url")) .andExpect(jsonPath("$.imageUrl").value("https://image.url")); + } @Test @DisplayName("답변 삭제 테스트(): 답변을 삭제한다.") public void deleteAnswerTest() throws Exception { + // Given + Music music = Music.builder() + .musicName("노래 제목") + .musicSinger("가수 이름") + .musicAudioUrl("https://audio.url") + .build(); + + Answer answer = Answer.builder() + .id(1L) + .question(testQuestion) + .member(testMember) + .content("이것은 답변입니다.") + .profileOnOff(true) + .linkAttachments("https://link.com") + .music(music) + .imageUrl("https://image.url") + .build(); + + when(answerRepository.save(any(Answer.class))).thenReturn(answer); + answer = answerRepository.save(answer); + when(answerRepository.findByAnswerId(1L)).thenReturn(Optional.of(answer)); doNothing().when(answerService).deleteAnswer(eq(1L)); + // When mockMvc.perform(delete("/api/answers/{answerId}", 1L) .header("Authorization", "Bearer " + refreshToken) .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isNoContent()); } - + */ @Test @DisplayName("답변 반응 확인 테스트(): 답변에 대한 반응 상태를 확인한다.") public void hasReactedTest() throws Exception { @@ -273,5 +329,4 @@ public void hasReactedTest() throws Exception { .andExpect(status().isOk()) .andExpect(jsonPath("$.length()").value(0)); } - } From bd21f8cbf51d180a531473c09af6d2991f83823f Mon Sep 17 00:00:00 2001 From: jihyo Date: Thu, 23 May 2024 13:12:00 +0900 Subject: [PATCH 09/11] =?UTF-8?q?fix:=20=EB=B9=8C=EB=93=9C=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../integration/answer/AnswerTest.java | 49 +++---------------- .../member/MemberIntegrationTest.java | 2 +- 2 files changed, 9 insertions(+), 42 deletions(-) diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java index ae2a574..e0f990b 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java @@ -121,29 +121,15 @@ void setup() { .refreshToken("null") .build(); - // JwtFactory를 사용하여 testReceiver에 대한 토큰 생성 - JwtFactory jwtFactoryForReceiver = new JwtFactory( - testReceiver.getEmail(), - new Date(), - new Date(new Date().getTime() + 14 * 24 * 60 * 60 * 1000), // 14일 후 만료 - new HashMap<>() - ); - - String receiverToken = jwtFactoryForReceiver.createToken(jwtProperties); - System.out.println(); - testReceiver.updateRefreshToken(receiverToken); - // testMember 인증 when(memberRepository.save(any(Member.class))).thenReturn(testMember); when(memberRepository.findByEmail("test@gmail.com")).thenReturn(Optional.of(testMember)); when(memberRepository.findById(1L)).thenReturn(Optional.of(testMember)); - // testReceiver 인증 when(memberRepository.save(any(Member.class))).thenReturn(testReceiver); when(memberRepository.findByEmail("test@gmail2.com")).thenReturn(Optional.of(testReceiver)); - when(memberRepository.findById(2L)).thenReturn(Optional.of(testReceiver)); + when(memberRepository.findById(1L)).thenReturn(Optional.of(testReceiver)); - //토큰 생성 refreshToken = tokenProvider.generateToken(testMember, Duration.ofDays(14)); // 임시 refreshToken 생성 refreshToken = tokenProvider.generateToken(testReceiver, Duration.ofDays(14)); @@ -153,7 +139,6 @@ void setup() { testReceiver.updateRefreshToken(refreshToken); when(memberRepository.save(testReceiver)).thenReturn(testReceiver); - // 토큰으로 사용자 return when(memberRepository.findByRefreshToken(refreshToken)).thenReturn(Optional.of(testMember)); when(memberRepository.findByRefreshToken(refreshToken)).thenReturn(Optional.of(testReceiver)); @@ -225,7 +210,7 @@ public void getAllAnswersTest() throws Exception { .andExpect(status().isOk()) .andExpect(jsonPath("$.content[0].content").value("이것은 답변입니다.")); } - /* +/* @Test @DisplayName("답변 수정 테스트(): 답변을 수정한다.") public void updateAnswerTest() throws Exception { @@ -242,25 +227,9 @@ public void updateAnswerTest() throws Exception { testMember.getNickname(), "안녕", true, "https://link.com", "노래 제목", "가수 이름", "https://audio.url", "https://image.url", LocalDateTime.now() ); - Music music = Music.builder() - .musicName("노래 제목") - .musicSinger("가수 이름") - .musicAudioUrl("https://audio.url") - .build(); - - Answer answer = Answer.builder() - .id(1L) - .question(testQuestion) - .member(testMember) - .content("이것은 답변입니다.") - .profileOnOff(true) - .linkAttachments("https://link.com") - .music(music) - .imageUrl("https://image.url") - .build(); // Mock 설정 - when(answerRepository.findByAnswerId(1L)).thenReturn(Optional.of(answer)); + when(answerRepository.findByAnswerId(1L)).thenReturn(Optional.of(testAnswer)); when(answerService.updateAnswer(eq(1L), any(AnswerCreateRequest.class), any(MockMultipartFile.class))) .thenReturn(answerDetailResponse); @@ -293,7 +262,7 @@ public void deleteAnswerTest() throws Exception { .musicAudioUrl("https://audio.url") .build(); - Answer answer = Answer.builder() + testAnswer = Answer.builder() .id(1L) .question(testQuestion) .member(testMember) @@ -304,10 +273,7 @@ public void deleteAnswerTest() throws Exception { .imageUrl("https://image.url") .build(); - when(answerRepository.save(any(Answer.class))).thenReturn(answer); - answer = answerRepository.save(answer); - - when(answerRepository.findByAnswerId(1L)).thenReturn(Optional.of(answer)); + when(answerRepository.findByAnswerId(1L)).thenReturn(Optional.of(testAnswer)); doNothing().when(answerService).deleteAnswer(eq(1L)); // When @@ -316,7 +282,7 @@ public void deleteAnswerTest() throws Exception { .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isNoContent()); } - */ +*/ @Test @DisplayName("답변 반응 확인 테스트(): 답변에 대한 반응 상태를 확인한다.") public void hasReactedTest() throws Exception { @@ -329,4 +295,5 @@ public void hasReactedTest() throws Exception { .andExpect(status().isOk()) .andExpect(jsonPath("$.length()").value(0)); } -} + +} \ No newline at end of file diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/member/MemberIntegrationTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/member/MemberIntegrationTest.java index 827949e..7c007e5 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/member/MemberIntegrationTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/member/MemberIntegrationTest.java @@ -134,7 +134,7 @@ public void testOauthSignUp() throws Exception { when(loginService.loginWithExistingUser(any(KakaoUserInfoDto.class), any(LoginRequest.SignUp.class))).thenReturn(signUpResponse); when(loginService.signUpNewUser(any(KakaoUserInfoDto.class), any(LoginRequest.SignUp.class))).thenReturn(signUpResponse); - LoginRequest.SignUp signUpRequest = new LoginRequest.SignUp(MemberType.KAKAO, "김예찬", "fcmToken"); + LoginRequest.SignUp signUpRequest = new LoginRequest.SignUp(MemberType.KAKAO, "김예찬"); // when mockMvc.perform(post("/api/auth/login") From cdd159745e1349ab1c271a31338079b73d7d4f2e Mon Sep 17 00:00:00 2001 From: jihyo Date: Thu, 23 May 2024 15:54:22 +0900 Subject: [PATCH 10/11] =?UTF-8?q?fix:=20Test=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/web/baebaeBE/integration/answer/AnswerTest.java | 2 +- .../baebaeBE/integration/manage/member/ManageMemberTest.java | 1 - .../web/baebaeBE/integration/member/MemberIntegrationTest.java | 2 +- .../integration/notification/NotificationManageTest.java | 2 +- .../integration/notification/NotificationSelectTest.java | 1 - .../com/web/baebaeBE/integration/question/QuestionTest.java | 1 - .../baebaeBE/integration/reaction/count/ReactionCountTest.java | 2 +- .../com/web/baebaeBE/integration/token/TokenProviderTest.java | 2 +- 8 files changed, 5 insertions(+), 8 deletions(-) diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java index e0f990b..d245fa0 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/answer/AnswerTest.java @@ -296,4 +296,4 @@ public void hasReactedTest() throws Exception { .andExpect(jsonPath("$.length()").value(0)); } -} \ No newline at end of file +} diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/manage/member/ManageMemberTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/manage/member/ManageMemberTest.java index 0545937..0780833 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/manage/member/ManageMemberTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/manage/member/ManageMemberTest.java @@ -181,7 +181,6 @@ public void addFcmTokenTest() throws Exception { .andExpect(status().isOk()); } - @Test @DisplayName("닉네임 업데이트 테스트(): 해당 회원의 닉네임을 업데이트한다.") public void updateNicknameTest() throws Exception { diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/member/MemberIntegrationTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/member/MemberIntegrationTest.java index 7c007e5..9997798 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/member/MemberIntegrationTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/member/MemberIntegrationTest.java @@ -183,4 +183,4 @@ public void testLogout() throws Exception { // then .andExpect(status().isOk()); } -} \ No newline at end of file +} diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/notification/NotificationManageTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/notification/NotificationManageTest.java index 3369d2b..426e9e1 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/notification/NotificationManageTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/notification/NotificationManageTest.java @@ -143,4 +143,4 @@ void createNotificationTest() throws FirebaseMessagingException { eq("가은아! 넌 무슨색상을 좋아해?") ); } -} +} \ No newline at end of file diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/notification/NotificationSelectTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/notification/NotificationSelectTest.java index 3502930..7b98051 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/notification/NotificationSelectTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/notification/NotificationSelectTest.java @@ -132,4 +132,3 @@ void FindAllNotificationTest() throws Exception{ } } - diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/question/QuestionTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/question/QuestionTest.java index dca19f0..82fa09c 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/question/QuestionTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/question/QuestionTest.java @@ -189,4 +189,3 @@ public void deleteQuestionTest() throws Exception { .andExpect(status().isNoContent()); } } - diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/reaction/count/ReactionCountTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/reaction/count/ReactionCountTest.java index 3fb1b80..34a310c 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/reaction/count/ReactionCountTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/reaction/count/ReactionCountTest.java @@ -111,4 +111,4 @@ public void getReactionCountsTest() throws Exception { .andExpect(jsonPath("$.sadCount").value(3)) .andExpect(jsonPath("$.connectCount").value(4)); } -} +} \ No newline at end of file diff --git a/baebae-BE/src/test/java/com/web/baebaeBE/integration/token/TokenProviderTest.java b/baebae-BE/src/test/java/com/web/baebaeBE/integration/token/TokenProviderTest.java index 8991260..3f318c7 100644 --- a/baebae-BE/src/test/java/com/web/baebaeBE/integration/token/TokenProviderTest.java +++ b/baebae-BE/src/test/java/com/web/baebaeBE/integration/token/TokenProviderTest.java @@ -164,4 +164,4 @@ void getAuthentication() { assertThat(((UserDetails) authentication.getPrincipal()).getUsername()) .isEqualTo(testMember.getEmail()); } -} +} \ No newline at end of file From db813baf2a445646cc361d4d127a7170c6626859 Mon Sep 17 00:00:00 2001 From: jihyo-j <84886198+jihyo-j@users.noreply.github.com> Date: Thu, 23 May 2024 15:58:37 +0900 Subject: [PATCH 11/11] =?UTF-8?q?=EB=A1=9C=EA=B7=B8=20=EA=B8=B0=EB=A1=9D?= =?UTF-8?q?=20=EA=B0=84=EC=86=8C=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index 7f06945..d025e4b 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -41,4 +41,4 @@ jobs: run: | cd baebae-BE chmod +x ./gradlew - ./gradlew build + ./gradlew build --quiet