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/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/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() diff --git a/src/test/java/team1/be/seamless/e2e/UserE2ETest.java b/src/test/java/team1/be/seamless/e2e/UserE2ETest.java index 5da7b354..412524e0 100644 --- a/src/test/java/team1/be/seamless/e2e/UserE2ETest.java +++ b/src/test/java/team1/be/seamless/e2e/UserE2ETest.java @@ -10,12 +10,12 @@ 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; 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 +40,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); @@ -89,6 +89,7 @@ public void setUp() { assertThat(responseEntity.getStatusCode()).isEqualTo(OK); } + @DirtiesContext @Test void 유저정보_삭제_실패() { HttpEntity requestEntity = new HttpEntity(null, headers); @@ -102,6 +103,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