### Question:
TaskController { @PutMapping("/users/{userId}/projects/{projectId}/pbis/{pbiId}/tasks") public TaskDTO updateTask(@RequestBody Task editedTask, @PathVariable Integer pbiId) throws Exception { return taskService.createOrEditTask(editedTask, pbiId); }  @GetMapping("/tasks") Iterable<Task> getAllTasks(); @GetMapping("/users/{userId}/projects/{projectId}/tasks") List<TaskDTO> getSprintTasks(@RequestParam Integer sprintId); @PostMapping("/users/{userId}/projects/{projectId}/pbis/{pbiId}/tasks") TaskDTO insertTask(@RequestBody Task newTask, @PathVariable Integer pbiId); @PutMapping("/users/{userId}/projects/{projectId}/pbis/{pbiId}/tasks") TaskDTO updateTask(@RequestBody Task editedTask, @PathVariable Integer pbiId); @DeleteMapping("/users/{userId}/projects/{projectId}/pbis/{pbiId}/tasks/{taskId}") void deleteTask(@PathVariable Integer taskId);  }### Answer:
@WithMockUser("spring") @Test @Order(3) public void updateTask() throws Exception { String url = "/users/2/projects/2/pbis/2/tasks"; Task editTask = this.repository.findById(3).get(); editTask.setDescription("springTask22"); editTask.setState(3); String json = mapper.writeValueAsString(editTask); mvc.perform( MockMvcRequestBuilders.put(url) .content(json) .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(jsonPath("$.id").value(3)) .andExpect(jsonPath("$.description").value("springTask22")) .andExpect(jsonPath("$.state").value(3)) .andExpect(jsonPath("$.storyId").value(2)); }