### Question:
NotificationController { @GetMapping("/users/{userId}/notifications") public List<Notification> getUserNotifications(@PathVariable Integer userId) { return notificationRepository.findByReceiver_Id(userId); }  @GetMapping("/notifications") Iterable<Notification> getAllNotifications(); @GetMapping("/users/{userId}/notifications") List<Notification> getUserNotifications(@PathVariable Integer userId); @PostMapping("/users/{userId}/notifications") void insertNotification(
            @RequestBody Notification newNotification, @PathVariable Integer userId); @DeleteMapping("/users/{userId}/notifications/{notificationId}") @ResponseStatus(HttpStatus.ACCEPTED) void deleteNotification(@PathVariable Integer notificationId);  }### Answer:
@WithMockUser("spring") @Test @Order(2) public void getUserNotifications() throws Exception { String url = "/users/1/notifications"; mvc.perform(MockMvcRequestBuilders.get(url).accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(jsonPath("$.[0].projectTitle").value("test project 1")) .andExpect(jsonPath("$.[0].role").value("Developer")) .andExpect(jsonPath("$.[0].type").value("Accept/Decline")) .andExpect(jsonPath("$.[0].message").value("test notification")); }