From 0ef9fbade3956de8dd28c85409f447ba6c405705 Mon Sep 17 00:00:00 2001 From: Kdonghs Date: Fri, 15 Nov 2024 02:41:54 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20UserE2ETest=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/team1/be/seamless/init/UserCreator.java | 4 +++- src/test/java/team1/be/seamless/e2e/UserE2ETest.java | 7 +++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/team1/be/seamless/init/UserCreator.java b/src/main/java/team1/be/seamless/init/UserCreator.java index b6e71bba..e94ff182 100644 --- a/src/main/java/team1/be/seamless/init/UserCreator.java +++ b/src/main/java/team1/be/seamless/init/UserCreator.java @@ -16,6 +16,8 @@ public UserCreator(UserService userService) { } public void creator() { - userService.createUser(new UserSimple("사용자1", "user1@google.com", "user1Image.jpg")); + userService.createUser(new UserSimple("사용자1", "user1@google.com", "https://user1Image.jpg")); + userService.createUser(new UserSimple("사용자2", "user2@google.com", "https://user2Image.jpg")); + userService.createUser(new UserSimple("사용자3", "user3@google.com", "https://user3Image.jpg")); } } diff --git a/src/test/java/team1/be/seamless/e2e/UserE2ETest.java b/src/test/java/team1/be/seamless/e2e/UserE2ETest.java index 5da7b354..8a50e29a 100644 --- a/src/test/java/team1/be/seamless/e2e/UserE2ETest.java +++ b/src/test/java/team1/be/seamless/e2e/UserE2ETest.java @@ -14,8 +14,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.http.HttpMethod.*; -import static org.springframework.http.HttpStatus.BAD_REQUEST; -import static org.springframework.http.HttpStatus.OK; +import static org.springframework.http.HttpStatus.*; @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) class UserE2ETest { @@ -40,7 +39,7 @@ public UserE2ETest(TestRestTemplate restTemplate) { public void setUp() { HttpEntity requestEntity = new HttpEntity<>(null); ResponseEntity responseEntity = restTemplate.exchange( - url + port + "/api/test/userToken/1", + url + port + "/api/test/userToken/2", POST, requestEntity, String.class); @@ -102,6 +101,6 @@ public void setUp() { requestEntity, String.class); System.out.println(responseEntity); - assertThat(responseEntity.getStatusCode()).isEqualTo(BAD_REQUEST); + assertThat(responseEntity.getStatusCode()).isEqualTo(NOT_FOUND); } } \ No newline at end of file From 01b39c414daafe17cae5aed281bdef7e940bef55 Mon Sep 17 00:00:00 2001 From: Kdonghs Date: Fri, 15 Nov 2024 02:46:49 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20UserE2ETest=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/java/team1/be/seamless/e2e/UserE2ETest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/java/team1/be/seamless/e2e/UserE2ETest.java b/src/test/java/team1/be/seamless/e2e/UserE2ETest.java index 8a50e29a..412524e0 100644 --- a/src/test/java/team1/be/seamless/e2e/UserE2ETest.java +++ b/src/test/java/team1/be/seamless/e2e/UserE2ETest.java @@ -10,6 +10,7 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; +import org.springframework.test.annotation.DirtiesContext; import team1.be.seamless.dto.UserDTO.UserUpdate; import static org.assertj.core.api.Assertions.assertThat; @@ -88,6 +89,7 @@ public void setUp() { assertThat(responseEntity.getStatusCode()).isEqualTo(OK); } + @DirtiesContext @Test void 유저정보_삭제_실패() { HttpEntity requestEntity = new HttpEntity(null, headers); From f47f12caf508a4e8192a24142c4b08d253823b16 Mon Sep 17 00:00:00 2001 From: sunandrabbit Date: Fri, 15 Nov 2024 03:45:10 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix=20:=20=EB=B3=80=EC=88=98=20=ED=83=80?= =?UTF-8?q?=EC=9E=85=EC=9C=BC=EB=A1=9C=20=EC=9D=B8=ED=95=9C=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../team1/be/seamless/controller/TaskController.java | 2 +- .../java/team1/be/seamless/service/TaskService.java | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/team1/be/seamless/controller/TaskController.java b/src/main/java/team1/be/seamless/controller/TaskController.java index 1288255f..b7874d57 100644 --- a/src/main/java/team1/be/seamless/controller/TaskController.java +++ b/src/main/java/team1/be/seamless/controller/TaskController.java @@ -52,7 +52,7 @@ public SingleResult getTask(@PathVariable("taskId") Long taskId) { public PageResult getTaskList(@PathVariable("projectId") Long projectId, @RequestParam(value = "status", required = false) String status, @RequestParam(value = "priority", required = false) String priority, - @RequestParam(value = "owner", required = false) long ownerId, + @RequestParam(value = "owner", required = false) Long ownerId, @Valid TaskDTO.getList param) { return PageMapper.toPageResult( diff --git a/src/main/java/team1/be/seamless/service/TaskService.java b/src/main/java/team1/be/seamless/service/TaskService.java index 02ea5be8..aafe6415 100644 --- a/src/main/java/team1/be/seamless/service/TaskService.java +++ b/src/main/java/team1/be/seamless/service/TaskService.java @@ -49,15 +49,13 @@ public TaskDetail getTask(Long taskId) { return taskMapper.toDetail(taskEntity); } - public Page getTaskList(Long projectId, String status, String priority, - long ownerId, getList param) { + public Page getTaskList(Long projectId, String status, String priority, Long ownerId, getList param) { +// MemberEntity memberEntity = memberRepository.findByIdAndIsDeleteFalse(ownerId) +// .orElseThrow(() -> new BaseHandler(HttpStatus.NOT_FOUND, "존재하지 않는 멤버")); - MemberEntity memberEntity = memberRepository.findByIdAndIsDeleteFalse(ownerId) - .orElseThrow(() -> new BaseHandler(HttpStatus.NOT_FOUND, "존재하지 않는 멤버")); - - Page taskEntities = taskRepository.findByProjectIdAndOptionalFilters(projectId, - status, priority, ownerId, param.toPageable()); + Page taskEntities = taskRepository.findByProjectIdAndOptionalFilters( + projectId, status, priority, ownerId, param.toPageable()); return new PageImpl<>( taskEntities.stream()