From a6df9fc1b2114724dc149e714e6a61be08d9f38a Mon Sep 17 00:00:00 2001 From: Jin Hyuk Date: Sun, 7 Jul 2024 02:23:04 +0900 Subject: [PATCH 01/11] =?UTF-8?q?test/#359:=20DeleteMember=20=ED=86=B5?= =?UTF-8?q?=ED=95=A9=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../member/DeleteMemberIntegrationTest.java | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 BE/exceed/src/test/java/com/gaebaljip/exceed/member/DeleteMemberIntegrationTest.java diff --git a/BE/exceed/src/test/java/com/gaebaljip/exceed/member/DeleteMemberIntegrationTest.java b/BE/exceed/src/test/java/com/gaebaljip/exceed/member/DeleteMemberIntegrationTest.java new file mode 100644 index 000000000..99b3919c2 --- /dev/null +++ b/BE/exceed/src/test/java/com/gaebaljip/exceed/member/DeleteMemberIntegrationTest.java @@ -0,0 +1,65 @@ +package com.gaebaljip.exceed.member; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.web.servlet.ResultActions; + +import com.gaebaljip.exceed.common.IntegrationTest; +import com.gaebaljip.exceed.common.WithMockUser; +import com.gaebaljip.exceed.member.adapter.out.persistence.MemberEntity; +import com.gaebaljip.exceed.member.adapter.out.persistence.MemberRepository; + +public class DeleteMemberIntegrationTest extends IntegrationTest { + @Autowired private MemberRepository memberRepository; + + @BeforeEach + void setUp() { + MemberEntity memberEntity = + MemberEntity.builder() + .email("aaa@naver.com") + .password("aaaa1234@@") + .checked(false) + .build(); + memberRepository.save(memberEntity); + } + + @Test + @WithMockUser(memberId = 1L) + @DisplayName("회원 탈퇴 성공") + void deleteMember() throws Exception { + + // given + + // when + ResultActions resultActions = mockMvc.perform(delete("/v1/members")); + + // eye + String responseBody = resultActions.andReturn().getResponse().getContentAsString(); + + // then + resultActions.andExpect(status().isOk()); + } + + @Test + @WithMockUser(memberId = 100L) + @DisplayName("회원 탈퇴 실패 : 회원이 존재하지 않음") + void deleteMember_fail() throws Exception { + + // given + + // when + ResultActions resultActions = mockMvc.perform(delete("/v1/members")); + + // eye + String responseBody = resultActions.andReturn().getResponse().getContentAsString(); + + // then + resultActions.andExpectAll(status().isBadRequest(), jsonPath("$.error.code").value("4448")); + } +} From c4347ccebbf8395233f77ff9f993f413f423228b Mon Sep 17 00:00:00 2001 From: Jin Hyuk Date: Sun, 7 Jul 2024 02:29:22 +0900 Subject: [PATCH 02/11] =?UTF-8?q?test/#359:=20DeleteMember=20=ED=86=B5?= =?UTF-8?q?=ED=95=A9=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../member/DeleteMemberIntegrationTest.java | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/BE/exceed/src/test/java/com/gaebaljip/exceed/member/DeleteMemberIntegrationTest.java b/BE/exceed/src/test/java/com/gaebaljip/exceed/member/DeleteMemberIntegrationTest.java index 99b3919c2..a9833555e 100644 --- a/BE/exceed/src/test/java/com/gaebaljip/exceed/member/DeleteMemberIntegrationTest.java +++ b/BE/exceed/src/test/java/com/gaebaljip/exceed/member/DeleteMemberIntegrationTest.java @@ -4,7 +4,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -12,23 +11,11 @@ import com.gaebaljip.exceed.common.IntegrationTest; import com.gaebaljip.exceed.common.WithMockUser; -import com.gaebaljip.exceed.member.adapter.out.persistence.MemberEntity; import com.gaebaljip.exceed.member.adapter.out.persistence.MemberRepository; public class DeleteMemberIntegrationTest extends IntegrationTest { @Autowired private MemberRepository memberRepository; - @BeforeEach - void setUp() { - MemberEntity memberEntity = - MemberEntity.builder() - .email("aaa@naver.com") - .password("aaaa1234@@") - .checked(false) - .build(); - memberRepository.save(memberEntity); - } - @Test @WithMockUser(memberId = 1L) @DisplayName("회원 탈퇴 성공") @@ -47,7 +34,7 @@ void deleteMember() throws Exception { } @Test - @WithMockUser(memberId = 100L) + @WithMockUser(memberId = 100000L) @DisplayName("회원 탈퇴 실패 : 회원이 존재하지 않음") void deleteMember_fail() throws Exception { From 9a327558a3daffbd6fe32f6fda98700b4d9eeccc Mon Sep 17 00:00:00 2001 From: Jin Hyuk Date: Mon, 8 Jul 2024 23:04:54 +0900 Subject: [PATCH 03/11] =?UTF-8?q?test/#359:=20UpdateMember=20=ED=86=B5?= =?UTF-8?q?=ED=95=A9=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/request/UpdateMemberRequest.java | 3 + .../member/UpdateMemberIntegrationTest.java | 85 +++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 BE/exceed/src/test/java/com/gaebaljip/exceed/member/UpdateMemberIntegrationTest.java diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/dto/request/UpdateMemberRequest.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/dto/request/UpdateMemberRequest.java index c7f86c083..ff7b97fd6 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/dto/request/UpdateMemberRequest.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/dto/request/UpdateMemberRequest.java @@ -9,6 +9,9 @@ import com.gaebaljip.exceed.member.domain.Activity; import com.gaebaljip.exceed.member.domain.Gender; +import lombok.Builder; + +@Builder public record UpdateMemberRequest( @NotNull(message = "키를 " + ValidationMessage.NOT_NULL) @Min(value = 0, message = "키는 " + ValidationMessage.MIN_0) diff --git a/BE/exceed/src/test/java/com/gaebaljip/exceed/member/UpdateMemberIntegrationTest.java b/BE/exceed/src/test/java/com/gaebaljip/exceed/member/UpdateMemberIntegrationTest.java new file mode 100644 index 000000000..beb1090dc --- /dev/null +++ b/BE/exceed/src/test/java/com/gaebaljip/exceed/member/UpdateMemberIntegrationTest.java @@ -0,0 +1,85 @@ +package com.gaebaljip.exceed.member; + +import static org.junit.jupiter.api.Assertions.assertAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.test.web.servlet.ResultActions; + +import com.gaebaljip.exceed.common.IntegrationTest; +import com.gaebaljip.exceed.common.WithMockUser; +import com.gaebaljip.exceed.dto.request.UpdateMemberRequest; +import com.gaebaljip.exceed.member.adapter.out.persistence.MemberEntity; +import com.gaebaljip.exceed.member.adapter.out.persistence.MemberRepository; +import com.gaebaljip.exceed.member.exception.MemberError; + +public class UpdateMemberIntegrationTest extends IntegrationTest { + + @Autowired private MemberRepository memberRepository; + + @Test + @WithMockUser(memberId = 1L) + @DisplayName("회원 수정 성공") + void when_updateMember_expected_success() throws Exception { + // given + Long memberId = 1L; + + UpdateMemberRequest updateMemberRequest = + UpdateMemberRequest.builder() + .height(180.3) + .activity("VERY_ACTIVE") + .age(40) + .gender("MALE") + .etc("회원 수정") + .build(); + + // when + ResultActions resultActions = + mockMvc.perform( + put("/v1/members") + .content(om.writeValueAsString(updateMemberRequest)) + .contentType(MediaType.APPLICATION_JSON)); + MemberEntity member = memberRepository.findById(memberId).get(); + // then + resultActions.andExpectAll(status().isOk()); + assertAll( + () -> assertEquals(member.getHeight(), updateMemberRequest.height()), + () -> assertEquals(member.getActivity().name(), updateMemberRequest.activity()), + () -> assertEquals(member.getAge(), updateMemberRequest.age()), + () -> assertEquals(member.getGender().name(), updateMemberRequest.gender()), + () -> assertEquals(member.getEtc(), updateMemberRequest.etc())); + } + + @Test + @WithMockUser(memberId = 1000L) + @DisplayName("회원 수정 실패 - 회원이 존재하지 않음") + void when_updateMember_InvalidMember_expected_exception() throws Exception { + // given + UpdateMemberRequest updateMemberRequest = + UpdateMemberRequest.builder() + .height(180.3) + .activity("VERY_ACTIVE") + .age(40) + .gender("MALE") + .etc("회원 수정") + .build(); + + // when + ResultActions resultActions = + mockMvc.perform( + put("/v1/members") + .content(om.writeValueAsString(updateMemberRequest)) + .contentType(MediaType.APPLICATION_JSON)); + + // then + resultActions.andExpectAll( + status().isBadRequest(), + jsonPath("$.error.reason").value(MemberError.INVALID_MEMBER.getReason())); + } +} From 7a56cdd6b9dc0ecf8b98c18d0df42da50d5c2dc2 Mon Sep 17 00:00:00 2001 From: Jin Hyuk Date: Mon, 8 Jul 2024 23:27:38 +0900 Subject: [PATCH 04/11] =?UTF-8?q?test/#359:=20UpdateMember=20Controller=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../member/UpdateMemberIntegrationTest.java | 2 +- .../adapter/UpdateMemberControllerTest.java | 241 ++++++++++++++++++ 2 files changed, 242 insertions(+), 1 deletion(-) create mode 100644 BE/exceed/src/test/java/com/gaebaljip/exceed/member/adapter/UpdateMemberControllerTest.java diff --git a/BE/exceed/src/test/java/com/gaebaljip/exceed/member/UpdateMemberIntegrationTest.java b/BE/exceed/src/test/java/com/gaebaljip/exceed/member/UpdateMemberIntegrationTest.java index beb1090dc..ff2baf2b6 100644 --- a/BE/exceed/src/test/java/com/gaebaljip/exceed/member/UpdateMemberIntegrationTest.java +++ b/BE/exceed/src/test/java/com/gaebaljip/exceed/member/UpdateMemberIntegrationTest.java @@ -59,7 +59,7 @@ void when_updateMember_expected_success() throws Exception { @Test @WithMockUser(memberId = 1000L) @DisplayName("회원 수정 실패 - 회원이 존재하지 않음") - void when_updateMember_InvalidMember_expected_exception() throws Exception { + void when_updateMember_member_invalid_expected_exception() throws Exception { // given UpdateMemberRequest updateMemberRequest = UpdateMemberRequest.builder() diff --git a/BE/exceed/src/test/java/com/gaebaljip/exceed/member/adapter/UpdateMemberControllerTest.java b/BE/exceed/src/test/java/com/gaebaljip/exceed/member/adapter/UpdateMemberControllerTest.java new file mode 100644 index 000000000..67873d5ce --- /dev/null +++ b/BE/exceed/src/test/java/com/gaebaljip/exceed/member/adapter/UpdateMemberControllerTest.java @@ -0,0 +1,241 @@ +package com.gaebaljip.exceed.member.adapter; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.http.MediaType; +import org.springframework.test.web.servlet.ResultActions; + +import com.gaebaljip.exceed.common.ControllerTest; +import com.gaebaljip.exceed.common.ValidationMessage; +import com.gaebaljip.exceed.common.WithMockUser; +import com.gaebaljip.exceed.dto.request.UpdateMemberRequest; +import com.gaebaljip.exceed.member.adapter.in.UpdateMemberController; +import com.gaebaljip.exceed.member.application.port.in.UpdateMemberUsecase; + +@WebMvcTest(UpdateMemberController.class) +public class UpdateMemberControllerTest extends ControllerTest { + @MockBean private UpdateMemberUsecase updateMemberUsecase; + + @Test + @DisplayName("회원 수정 성공") + @WithMockUser + void when_updateMember_expected_success() throws Exception { + // given + UpdateMemberRequest updateMemberRequest = + UpdateMemberRequest.builder() + .height(180.3) + .activity("VERY_ACTIVE") + .age(40) + .gender("MALE") + .etc("회원 수정") + .build(); + // when + ResultActions resultActions = + mockMvc.perform( + put("/v1/members") + .content(om.writeValueAsString(updateMemberRequest)) + .contentType(MediaType.APPLICATION_JSON)); + + // then + resultActions.andExpect(status().isOk()); + } + + @Test + @DisplayName("회원 수정 실패 - 키를 입력하지 않은 경우") + @WithMockUser + void when_updateMember_height_null_expected_exception() throws Exception { + // given + UpdateMemberRequest updateMemberRequest = + UpdateMemberRequest.builder() + .height(null) + .activity("VERY_ACTIVE") + .age(40) + .gender("MALE") + .etc("회원 수정") + .build(); + + // when + ResultActions resultActions = + mockMvc.perform( + put("/v1/members") + .content(om.writeValueAsString(updateMemberRequest)) + .contentType(MediaType.APPLICATION_JSON)); + + // then + resultActions.andExpectAll( + status().isBadRequest(), + jsonPath("$.error.reason").value("키를 " + ValidationMessage.NOT_NULL)); + } + + @Test + @DisplayName("회원 수정 실패 - 키가 0보다 작은 경우") + @WithMockUser + void when_updateMember_height_negative_expected_exception() throws Exception { + // given + UpdateMemberRequest updateMemberRequest = + UpdateMemberRequest.builder() + .height(-1.0) + .activity("VERY_ACTIVE") + .age(40) + .gender("MALE") + .etc("회원 수정") + .build(); + + // when + ResultActions resultActions = + mockMvc.perform( + put("/v1/members") + .content(om.writeValueAsString(updateMemberRequest)) + .contentType(MediaType.APPLICATION_JSON)); + + // then + resultActions.andExpectAll( + status().isBadRequest(), + jsonPath("$.error.reason").value("키는 " + ValidationMessage.MIN_0)); + } + + @Test + @DisplayName("회원 수정 실패 - 나이를 입력하지 않은 경우") + @WithMockUser + void when_updateMember_age_null_expected_exception() throws Exception { + // given + UpdateMemberRequest updateMemberRequest = + UpdateMemberRequest.builder() + .height(180.3) + .activity("VERY_ACTIVE") + .age(null) + .gender("MALE") + .etc("회원 수정") + .build(); + + // when + ResultActions resultActions = + mockMvc.perform( + put("/v1/members") + .content(om.writeValueAsString(updateMemberRequest)) + .contentType(MediaType.APPLICATION_JSON)); + + // then + resultActions.andExpectAll( + status().isBadRequest(), + jsonPath("$.error.reason").value("나이를 " + ValidationMessage.NOT_NULL)); + } + + @Test + @DisplayName("회원 수정 실패 - 나이가 0보다 작은 경우") + @WithMockUser + void when_updateMember_age_negative_expected_exception() throws Exception { + // given + UpdateMemberRequest updateMemberRequest = + UpdateMemberRequest.builder() + .height(180.3) + .activity("VERY_ACTIVE") + .age(-1) + .gender("MALE") + .etc("회원 수정") + .build(); + + // when + ResultActions resultActions = + mockMvc.perform( + put("/v1/members") + .content(om.writeValueAsString(updateMemberRequest)) + .contentType(MediaType.APPLICATION_JSON)); + + // then + resultActions.andExpectAll( + status().isBadRequest(), + jsonPath("$.error.reason").value("나이는 " + ValidationMessage.MIN_0)); + } + + @Test + @DisplayName("회원 수정 실패 - 성별이 올바르지 않은 경우") + @WithMockUser + void when_updateMember_gender_invalid_expected_exception() throws Exception { + // given + String gender = "MALLY"; + + UpdateMemberRequest updateMemberRequest = + UpdateMemberRequest.builder() + .height(180.3) + .activity("VERY_ACTIVE") + .age(40) + .gender(gender) + .etc("회원 수정") + .build(); + + // when + ResultActions resultActions = + mockMvc.perform( + put("/v1/members") + .content(om.writeValueAsString(updateMemberRequest)) + .contentType(MediaType.APPLICATION_JSON)); + + // then + resultActions.andExpectAll( + status().isBadRequest(), + jsonPath("$.error.reason").value(gender + "는 올바르지 않은 값입니다.")); + } + + @Test + @DisplayName("회원 수정 실패 - 활동량이 올바르지 않은 경우") + @WithMockUser + void when_updateMember_activity_invalid_expected_exception() throws Exception { + // given + String activity = "INVALID"; + + UpdateMemberRequest updateMemberRequest = + UpdateMemberRequest.builder() + .height(180.3) + .activity(activity) + .age(40) + .gender("MALE") + .etc("회원 수정") + .build(); + + // when + ResultActions resultActions = + mockMvc.perform( + put("/v1/members") + .content(om.writeValueAsString(updateMemberRequest)) + .contentType(MediaType.APPLICATION_JSON)); + + // then + resultActions.andExpectAll( + status().isBadRequest(), + jsonPath("$.error.reason").value(activity + "는 올바르지 않은 값입니다.")); + } + + @Test + @DisplayName("회원 수정 실패 - 기타사항을 입력하지 않은 경우") + @WithMockUser + void when_updateMember_etc_null_expected_exception() throws Exception { + // given + UpdateMemberRequest updateMemberRequest = + UpdateMemberRequest.builder() + .height(180.3) + .activity("VERY_ACTIVE") + .age(40) + .gender("MALE") + .etc(null) + .build(); + + // when + ResultActions resultActions = + mockMvc.perform( + put("/v1/members") + .content(om.writeValueAsString(updateMemberRequest)) + .contentType(MediaType.APPLICATION_JSON)); + + // then + resultActions.andExpectAll( + status().isBadRequest(), + jsonPath("$.error.reason").value("기타사항을 " + ValidationMessage.NOT_BLANK)); + } +} From d7938a2fd157d67b765ffd2aa93e86f0df2efda2 Mon Sep 17 00:00:00 2001 From: Jin Hyuk Date: Wed, 10 Jul 2024 23:28:23 +0900 Subject: [PATCH 05/11] =?UTF-8?q?test/#359:=20LoggingFilter=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Swagger 요청은 로깅 안되게 수정 --- .../com/gaebaljip/exceed/common/log/LoggingFilter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/common/log/LoggingFilter.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/common/log/LoggingFilter.java index f38010081..893bba8d0 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/common/log/LoggingFilter.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/common/log/LoggingFilter.java @@ -20,7 +20,12 @@ @Slf4j public class LoggingFilter extends OncePerRequestFilter { private final List excludeUrl = - List.of("/actuator/health", "/actuator/prometheus", "/v1/health"); + List.of( + "/actuator/health", + "/actuator/prometheus", + "/v1/health", + "/api-docs/swagger-config", + "/api-docs"); @Override protected void doFilterInternal( From 44fc422002629f6784bf10763e7185016a324274 Mon Sep 17 00:00:00 2001 From: Jin Hyuk Date: Wed, 10 Jul 2024 23:31:20 +0900 Subject: [PATCH 06/11] test/#359: EmitterControllerTest --- .../adapter/in/EmitterControllerTest.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 BE/exceed/src/test/java/com/gaebaljip/exceed/infrastructure/adapter/in/EmitterControllerTest.java diff --git a/BE/exceed/src/test/java/com/gaebaljip/exceed/infrastructure/adapter/in/EmitterControllerTest.java b/BE/exceed/src/test/java/com/gaebaljip/exceed/infrastructure/adapter/in/EmitterControllerTest.java new file mode 100644 index 000000000..c4c13dba3 --- /dev/null +++ b/BE/exceed/src/test/java/com/gaebaljip/exceed/infrastructure/adapter/in/EmitterControllerTest.java @@ -0,0 +1,38 @@ +package com.gaebaljip.exceed.infrastructure.adapter.in; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.BDDMockito.given; +import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.web.servlet.ResultActions; +import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; + +import com.gaebaljip.exceed.common.ControllerTest; +import com.gaebaljip.exceed.common.WithMockUser; +import com.gaebaljip.exceed.infrastructure.sse.adapter.in.EmitterController; +import com.gaebaljip.exceed.infrastructure.sse.application.port.in.ConnectEmitterUseCase; + +@WebMvcTest(EmitterController.class) +public class EmitterControllerTest extends ControllerTest { + + @MockBean private ConnectEmitterUseCase connectEmitterUseCase; + + @Test + @WithMockUser(memberId = 1L) + void when_connect_expected_success() throws Exception { + + // given + given(connectEmitterUseCase.execute(any(), any())).willReturn(new SseEmitter()); + + // when + ResultActions resultActions = + mockMvc.perform(get("/api/emitter/connect").contentType("text/event-stream")); + + // then + resultActions.andExpect(status().isOk()); + } +} From 385db5fc2f4625db4845d13bf7052ea0ba5b6571 Mon Sep 17 00:00:00 2001 From: Jin Hyuk Date: Fri, 12 Jul 2024 16:11:12 +0900 Subject: [PATCH 07/11] =?UTF-8?q?test/#359:=20UpdateWeightController=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapter/in/UpdateWeightController.java | 9 +-- .../in/UpdateWeightControllerTest.java | 67 +++++++++++++++++++ 2 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 BE/exceed/src/test/java/com/gaebaljip/exceed/member/adapter/in/UpdateWeightControllerTest.java diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/member/adapter/in/UpdateWeightController.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/member/adapter/in/UpdateWeightController.java index c710343ea..060d64233 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/member/adapter/in/UpdateWeightController.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/member/adapter/in/UpdateWeightController.java @@ -6,6 +6,7 @@ import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -16,8 +17,8 @@ import com.gaebaljip.exceed.common.event.UpdateWeightEvent; import com.gaebaljip.exceed.dto.request.UpdateWeightRequest; import com.gaebaljip.exceed.dto.response.UpdateWeightResponse; -import com.gaebaljip.exceed.member.application.UpdateWeightService; import com.gaebaljip.exceed.member.application.port.in.UpdateWeightCommand; +import com.gaebaljip.exceed.member.application.port.in.UpdateWeightUsecase; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.security.SecurityRequirement; @@ -30,16 +31,16 @@ @SecurityRequirement(name = "access-token") @Tag(name = "[몸무게 수정]") public class UpdateWeightController { - private final UpdateWeightService updateWeightService; + private final UpdateWeightUsecase updateWeightUsecase; @Operation(summary = "회원 몸무게 및 목표 몸무게 수정", description = "회원 몸무게 및 목표 몸무게를 수정한다.") @PatchMapping("/members/weight") public ApiResponse updateWeight( HttpServletRequest servletRequest, - UpdateWeightRequest request, + @RequestBody UpdateWeightRequest request, @AuthenticationMemberId Long memberId) { UpdateWeightResponse response = - updateWeightService.execute( + updateWeightUsecase.execute( UpdateWeightCommand.of(request.weight(), request.targetWeight(), memberId)); Events.raise( UpdateWeightEvent.from( diff --git a/BE/exceed/src/test/java/com/gaebaljip/exceed/member/adapter/in/UpdateWeightControllerTest.java b/BE/exceed/src/test/java/com/gaebaljip/exceed/member/adapter/in/UpdateWeightControllerTest.java new file mode 100644 index 000000000..193266192 --- /dev/null +++ b/BE/exceed/src/test/java/com/gaebaljip/exceed/member/adapter/in/UpdateWeightControllerTest.java @@ -0,0 +1,67 @@ +package com.gaebaljip.exceed.member.adapter.in; + +import static org.junit.jupiter.api.Assertions.assertAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.context.ApplicationEventPublisher; +import org.springframework.http.MediaType; +import org.springframework.test.context.event.ApplicationEvents; +import org.springframework.test.context.event.RecordApplicationEvents; +import org.springframework.test.web.servlet.ResultActions; + +import com.gaebaljip.exceed.common.ControllerTest; +import com.gaebaljip.exceed.common.WithMockUser; +import com.gaebaljip.exceed.common.event.Events; +import com.gaebaljip.exceed.common.event.UpdateWeightEvent; +import com.gaebaljip.exceed.dto.request.UpdateWeightRequest; +import com.gaebaljip.exceed.member.application.port.in.UpdateWeightUsecase; + +@RecordApplicationEvents +@WebMvcTest(UpdateWeightController.class) +public class UpdateWeightControllerTest extends ControllerTest { + + @MockBean UpdateWeightUsecase updateWeightUsecase; + @Autowired ApplicationEvents events; + @Autowired ApplicationEventPublisher applicationEventPublisher; + + @BeforeEach + void setUp() { + Events.setPublisher(applicationEventPublisher); + } + + @AfterEach + void tearDown() { + Events.reset(); + } + + @Test + @WithMockUser(memberId = 1L) + @DisplayName("몸무게 수정 성공") + void when_updateWeight_expected_success() throws Exception { + // given + UpdateWeightRequest updateWeightRequest = + UpdateWeightRequest.builder().weight(50.0).targetWeight(70.5).build(); + + // when + ResultActions resultActions = + mockMvc.perform( + patch("/v1/members/weight") + .content(om.writeValueAsString(updateWeightRequest)) + .contentType(MediaType.APPLICATION_JSON)); + + long count = events.stream(UpdateWeightEvent.class).count(); + + // then + resultActions.andExpectAll(status().isOk()); + assertAll(() -> assertEquals(1, count)); + } +} From a4ff9e7f950595927ac0c98dbb0bd5e5ad351ff7 Mon Sep 17 00:00:00 2001 From: Jin Hyuk Date: Fri, 12 Jul 2024 16:11:24 +0900 Subject: [PATCH 08/11] =?UTF-8?q?test/#359:=20UpdateWeight=20=ED=86=B5?= =?UTF-8?q?=ED=95=A9=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../member/UpdateWeightIntegrationTest.java | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 BE/exceed/src/test/java/com/gaebaljip/exceed/member/UpdateWeightIntegrationTest.java diff --git a/BE/exceed/src/test/java/com/gaebaljip/exceed/member/UpdateWeightIntegrationTest.java b/BE/exceed/src/test/java/com/gaebaljip/exceed/member/UpdateWeightIntegrationTest.java new file mode 100644 index 000000000..c714f0e3c --- /dev/null +++ b/BE/exceed/src/test/java/com/gaebaljip/exceed/member/UpdateWeightIntegrationTest.java @@ -0,0 +1,46 @@ +package com.gaebaljip.exceed.member; + +import static org.junit.jupiter.api.Assertions.assertAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.test.web.servlet.ResultActions; + +import com.gaebaljip.exceed.common.IntegrationTest; +import com.gaebaljip.exceed.common.WithMockUser; +import com.gaebaljip.exceed.dto.request.UpdateWeightRequest; +import com.gaebaljip.exceed.member.adapter.out.persistence.MemberEntity; +import com.gaebaljip.exceed.member.adapter.out.persistence.MemberRepository; + +public class UpdateWeightIntegrationTest extends IntegrationTest { + @Autowired private MemberRepository memberRepository; + + @Test + @DisplayName("몸무게 수정 성공") + @WithMockUser(memberId = 1L) + void when_updateWeight_expected_success() throws Exception { + // given + Long memberId = 1L; + UpdateWeightRequest updateWeightRequest = + UpdateWeightRequest.builder().weight(50.0).targetWeight(70.5).build(); + + // when + ResultActions resultActions = + mockMvc.perform( + patch("/v1/members/weight") + .content(om.writeValueAsString(updateWeightRequest)) + .contentType(MediaType.APPLICATION_JSON)); + MemberEntity member = memberRepository.findById(memberId).get(); + + // then + resultActions.andExpectAll(status().isOk()); + assertAll( + () -> assertEquals(updateWeightRequest.weight(), member.getWeight()), + () -> assertEquals(updateWeightRequest.targetWeight(), member.getTargetWeight())); + } +} From 296720bc22a7e89eff81bb6806e5a885587d70ab Mon Sep 17 00:00:00 2001 From: Jin Hyuk Date: Fri, 12 Jul 2024 16:11:55 +0900 Subject: [PATCH 09/11] =?UTF-8?q?test/#359:=20GetWeight=20=ED=86=B5?= =?UTF-8?q?=ED=95=A9=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../member/GetWeightIntegrationTest.java | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 BE/exceed/src/test/java/com/gaebaljip/exceed/member/GetWeightIntegrationTest.java diff --git a/BE/exceed/src/test/java/com/gaebaljip/exceed/member/GetWeightIntegrationTest.java b/BE/exceed/src/test/java/com/gaebaljip/exceed/member/GetWeightIntegrationTest.java new file mode 100644 index 000000000..aa5470378 --- /dev/null +++ b/BE/exceed/src/test/java/com/gaebaljip/exceed/member/GetWeightIntegrationTest.java @@ -0,0 +1,40 @@ +package com.gaebaljip.exceed.member; + +import static org.junit.jupiter.api.Assertions.assertAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.web.servlet.ResultActions; + +import com.gaebaljip.exceed.common.IntegrationTest; +import com.gaebaljip.exceed.common.WithMockUser; +import com.gaebaljip.exceed.member.adapter.out.persistence.MemberEntity; +import com.gaebaljip.exceed.member.adapter.out.persistence.MemberRepository; + +public class GetWeightIntegrationTest extends IntegrationTest { + + @Autowired private MemberRepository memberRepository; + + @Test + @WithMockUser(memberId = 1L) + @DisplayName("몸무게 조회 성공") + void when_getWeight_expected_success() throws Exception { + // given + long memberId = 1L; + + // when + ResultActions resultActions = mockMvc.perform(get("/v1/members/weight")); + + MemberEntity member = memberRepository.findById(memberId).get(); + + // then + resultActions.andExpect(status().isOk()); + assertAll( + () -> assertEquals(member.getWeight(), 70.0), + () -> assertEquals(member.getTargetWeight(), 68.0)); + } +} From 3a713d28a27ad661c57b3180d94994c800bd4982 Mon Sep 17 00:00:00 2001 From: Jin Hyuk Date: Fri, 12 Jul 2024 18:25:36 +0900 Subject: [PATCH 10/11] =?UTF-8?q?test/#359:=20DeleteMemberIntegrationTest?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 회원 탈퇴 데이터 검증 --- .../gaebaljip/exceed/member/DeleteMemberIntegrationTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/BE/exceed/src/test/java/com/gaebaljip/exceed/member/DeleteMemberIntegrationTest.java b/BE/exceed/src/test/java/com/gaebaljip/exceed/member/DeleteMemberIntegrationTest.java index a9833555e..99329268f 100644 --- a/BE/exceed/src/test/java/com/gaebaljip/exceed/member/DeleteMemberIntegrationTest.java +++ b/BE/exceed/src/test/java/com/gaebaljip/exceed/member/DeleteMemberIntegrationTest.java @@ -1,5 +1,7 @@ package com.gaebaljip.exceed.member; +import static org.junit.jupiter.api.Assertions.assertAll; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -22,7 +24,7 @@ public class DeleteMemberIntegrationTest extends IntegrationTest { void deleteMember() throws Exception { // given - + long memberId = 1L; // when ResultActions resultActions = mockMvc.perform(delete("/v1/members")); @@ -31,6 +33,7 @@ void deleteMember() throws Exception { // then resultActions.andExpect(status().isOk()); + assertAll(() -> assertFalse(memberRepository.existsById(memberId))); } @Test From 8eeb5d6664746d603303f53e801f57847e17a2ef Mon Sep 17 00:00:00 2001 From: Jin Hyuk Date: Sat, 20 Jul 2024 02:20:54 +0900 Subject: [PATCH 11/11] conflict resolve --- .../adapter/in/member/UpdateWeightController.java | 2 +- .../adapter/in/member/UpdateMemberControllerTest.java | 4 ++-- .../adapter/in/member/UpdateWeightControllerTest.java | 6 +++--- .../adapter/in/EmitterControllerTest.java | 4 ++-- .../member/DeleteMemberIntegrationTest.java | 4 ++-- .../integration/member/GetWeightIntegrationTest.java | 6 +++--- .../member/UpdateMemberIntegrationTest.java | 10 +++++----- .../member/UpdateWeightIntegrationTest.java | 8 ++++---- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/UpdateWeightController.java b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/UpdateWeightController.java index 363178d29..871d3b617 100644 --- a/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/UpdateWeightController.java +++ b/BE/exceed/src/main/java/com/gaebaljip/exceed/adapter/in/member/UpdateWeightController.java @@ -13,7 +13,7 @@ import com.gaebaljip.exceed.adapter.in.member.request.UpdateWeightRequest; import com.gaebaljip.exceed.adapter.in.member.response.UpdateWeightResponse; import com.gaebaljip.exceed.application.port.in.member.UpdateWeightCommand; -import com.gaebaljip.exceed.application.service.member.UpdateWeightService; +import com.gaebaljip.exceed.application.port.in.member.UpdateWeightUsecase; import com.gaebaljip.exceed.common.ApiResponse; import com.gaebaljip.exceed.common.ApiResponseGenerator; import com.gaebaljip.exceed.common.annotation.AuthenticationMemberId; diff --git a/BE/exceed/src/test/java/com/gaebaljip/exceed/adapter/in/member/UpdateMemberControllerTest.java b/BE/exceed/src/test/java/com/gaebaljip/exceed/adapter/in/member/UpdateMemberControllerTest.java index d33b0eafd..649a94143 100644 --- a/BE/exceed/src/test/java/com/gaebaljip/exceed/adapter/in/member/UpdateMemberControllerTest.java +++ b/BE/exceed/src/test/java/com/gaebaljip/exceed/adapter/in/member/UpdateMemberControllerTest.java @@ -1,4 +1,4 @@ -package com.gaebaljip.exceed.member.adapter; +package com.gaebaljip.exceed.adapter.in.member; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; @@ -17,7 +17,7 @@ import com.gaebaljip.exceed.common.ValidationMessage; import com.gaebaljip.exceed.common.WithMockUser; -@WebMvcTest(UpdateMemberControllerTest.class) +@WebMvcTest(UpdateMemberController.class) public class UpdateMemberControllerTest extends ControllerTest { @MockBean private UpdateMemberUsecase updateMemberUsecase; diff --git a/BE/exceed/src/test/java/com/gaebaljip/exceed/adapter/in/member/UpdateWeightControllerTest.java b/BE/exceed/src/test/java/com/gaebaljip/exceed/adapter/in/member/UpdateWeightControllerTest.java index 193266192..0d95b7096 100644 --- a/BE/exceed/src/test/java/com/gaebaljip/exceed/adapter/in/member/UpdateWeightControllerTest.java +++ b/BE/exceed/src/test/java/com/gaebaljip/exceed/adapter/in/member/UpdateWeightControllerTest.java @@ -1,4 +1,4 @@ -package com.gaebaljip.exceed.member.adapter.in; +package com.gaebaljip.exceed.adapter.in.member; import static org.junit.jupiter.api.Assertions.assertAll; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -18,12 +18,12 @@ import org.springframework.test.context.event.RecordApplicationEvents; import org.springframework.test.web.servlet.ResultActions; +import com.gaebaljip.exceed.adapter.in.member.request.UpdateWeightRequest; +import com.gaebaljip.exceed.application.port.in.member.UpdateWeightUsecase; import com.gaebaljip.exceed.common.ControllerTest; import com.gaebaljip.exceed.common.WithMockUser; import com.gaebaljip.exceed.common.event.Events; import com.gaebaljip.exceed.common.event.UpdateWeightEvent; -import com.gaebaljip.exceed.dto.request.UpdateWeightRequest; -import com.gaebaljip.exceed.member.application.port.in.UpdateWeightUsecase; @RecordApplicationEvents @WebMvcTest(UpdateWeightController.class) diff --git a/BE/exceed/src/test/java/com/gaebaljip/exceed/infrastructure/adapter/in/EmitterControllerTest.java b/BE/exceed/src/test/java/com/gaebaljip/exceed/infrastructure/adapter/in/EmitterControllerTest.java index c4c13dba3..5b5b2912b 100644 --- a/BE/exceed/src/test/java/com/gaebaljip/exceed/infrastructure/adapter/in/EmitterControllerTest.java +++ b/BE/exceed/src/test/java/com/gaebaljip/exceed/infrastructure/adapter/in/EmitterControllerTest.java @@ -11,10 +11,10 @@ import org.springframework.test.web.servlet.ResultActions; import org.springframework.web.servlet.mvc.method.annotation.SseEmitter; +import com.gaebaljip.exceed.adapter.in.notify.EmitterController; +import com.gaebaljip.exceed.application.port.in.notify.ConnectEmitterUseCase; import com.gaebaljip.exceed.common.ControllerTest; import com.gaebaljip.exceed.common.WithMockUser; -import com.gaebaljip.exceed.infrastructure.sse.adapter.in.EmitterController; -import com.gaebaljip.exceed.infrastructure.sse.application.port.in.ConnectEmitterUseCase; @WebMvcTest(EmitterController.class) public class EmitterControllerTest extends ControllerTest { diff --git a/BE/exceed/src/test/java/com/gaebaljip/exceed/integration/member/DeleteMemberIntegrationTest.java b/BE/exceed/src/test/java/com/gaebaljip/exceed/integration/member/DeleteMemberIntegrationTest.java index 99329268f..1e1760be3 100644 --- a/BE/exceed/src/test/java/com/gaebaljip/exceed/integration/member/DeleteMemberIntegrationTest.java +++ b/BE/exceed/src/test/java/com/gaebaljip/exceed/integration/member/DeleteMemberIntegrationTest.java @@ -1,4 +1,4 @@ -package com.gaebaljip.exceed.member; +package com.gaebaljip.exceed.integration.member; import static org.junit.jupiter.api.Assertions.assertAll; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -11,9 +11,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.web.servlet.ResultActions; +import com.gaebaljip.exceed.adapter.out.jpa.member.MemberRepository; import com.gaebaljip.exceed.common.IntegrationTest; import com.gaebaljip.exceed.common.WithMockUser; -import com.gaebaljip.exceed.member.adapter.out.persistence.MemberRepository; public class DeleteMemberIntegrationTest extends IntegrationTest { @Autowired private MemberRepository memberRepository; diff --git a/BE/exceed/src/test/java/com/gaebaljip/exceed/integration/member/GetWeightIntegrationTest.java b/BE/exceed/src/test/java/com/gaebaljip/exceed/integration/member/GetWeightIntegrationTest.java index aa5470378..82da88e4a 100644 --- a/BE/exceed/src/test/java/com/gaebaljip/exceed/integration/member/GetWeightIntegrationTest.java +++ b/BE/exceed/src/test/java/com/gaebaljip/exceed/integration/member/GetWeightIntegrationTest.java @@ -1,4 +1,4 @@ -package com.gaebaljip.exceed.member; +package com.gaebaljip.exceed.integration.member; import static org.junit.jupiter.api.Assertions.assertAll; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -10,10 +10,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.web.servlet.ResultActions; +import com.gaebaljip.exceed.adapter.out.jpa.member.MemberRepository; +import com.gaebaljip.exceed.application.domain.member.MemberEntity; import com.gaebaljip.exceed.common.IntegrationTest; import com.gaebaljip.exceed.common.WithMockUser; -import com.gaebaljip.exceed.member.adapter.out.persistence.MemberEntity; -import com.gaebaljip.exceed.member.adapter.out.persistence.MemberRepository; public class GetWeightIntegrationTest extends IntegrationTest { diff --git a/BE/exceed/src/test/java/com/gaebaljip/exceed/integration/member/UpdateMemberIntegrationTest.java b/BE/exceed/src/test/java/com/gaebaljip/exceed/integration/member/UpdateMemberIntegrationTest.java index ff2baf2b6..0feb82032 100644 --- a/BE/exceed/src/test/java/com/gaebaljip/exceed/integration/member/UpdateMemberIntegrationTest.java +++ b/BE/exceed/src/test/java/com/gaebaljip/exceed/integration/member/UpdateMemberIntegrationTest.java @@ -1,4 +1,4 @@ -package com.gaebaljip.exceed.member; +package com.gaebaljip.exceed.integration.member; import static org.junit.jupiter.api.Assertions.assertAll; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -12,12 +12,12 @@ import org.springframework.http.MediaType; import org.springframework.test.web.servlet.ResultActions; +import com.gaebaljip.exceed.adapter.in.member.request.UpdateMemberRequest; +import com.gaebaljip.exceed.adapter.out.jpa.member.MemberRepository; +import com.gaebaljip.exceed.application.domain.member.MemberEntity; import com.gaebaljip.exceed.common.IntegrationTest; import com.gaebaljip.exceed.common.WithMockUser; -import com.gaebaljip.exceed.dto.request.UpdateMemberRequest; -import com.gaebaljip.exceed.member.adapter.out.persistence.MemberEntity; -import com.gaebaljip.exceed.member.adapter.out.persistence.MemberRepository; -import com.gaebaljip.exceed.member.exception.MemberError; +import com.gaebaljip.exceed.common.exception.member.MemberError; public class UpdateMemberIntegrationTest extends IntegrationTest { diff --git a/BE/exceed/src/test/java/com/gaebaljip/exceed/integration/member/UpdateWeightIntegrationTest.java b/BE/exceed/src/test/java/com/gaebaljip/exceed/integration/member/UpdateWeightIntegrationTest.java index c714f0e3c..db9790416 100644 --- a/BE/exceed/src/test/java/com/gaebaljip/exceed/integration/member/UpdateWeightIntegrationTest.java +++ b/BE/exceed/src/test/java/com/gaebaljip/exceed/integration/member/UpdateWeightIntegrationTest.java @@ -1,4 +1,4 @@ -package com.gaebaljip.exceed.member; +package com.gaebaljip.exceed.integration.member; import static org.junit.jupiter.api.Assertions.assertAll; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -11,11 +11,11 @@ import org.springframework.http.MediaType; import org.springframework.test.web.servlet.ResultActions; +import com.gaebaljip.exceed.adapter.in.member.request.UpdateWeightRequest; +import com.gaebaljip.exceed.adapter.out.jpa.member.MemberRepository; +import com.gaebaljip.exceed.application.domain.member.MemberEntity; import com.gaebaljip.exceed.common.IntegrationTest; import com.gaebaljip.exceed.common.WithMockUser; -import com.gaebaljip.exceed.dto.request.UpdateWeightRequest; -import com.gaebaljip.exceed.member.adapter.out.persistence.MemberEntity; -import com.gaebaljip.exceed.member.adapter.out.persistence.MemberRepository; public class UpdateWeightIntegrationTest extends IntegrationTest { @Autowired private MemberRepository memberRepository;