### Question:
UserController { @PostMapping("/signup") public User insertUser(@RequestBody User newUser) { return userService.createUser(newUser); }  @GetMapping("/users") Iterable<User> getAllUsers(); @GetMapping("/exists/username/{username}") boolean existsUsername(@PathVariable String username); @GetMapping("/exists/email/{email}") boolean existsEmail(@PathVariable String email); @PostMapping("/signup") User insertUser(@RequestBody User newUser); @GetMapping("/profile/{username}") Profile getUserProfile(@PathVariable String username); @PutMapping("/profile/{username}") Profile updateUserProfile(
            @PathVariable String username, @RequestBody Profile updatedProfile); @PostMapping("/password/{userId}/matches") boolean passwordMatches(
            @PathVariable Integer userId, @RequestBody AuthenticationRequest plainPassword); @PutMapping("/password/{userId}/update") String passwordUpdate(
            @PathVariable Integer userId, @RequestBody AuthenticationRequest plainPassword); @DeleteMapping("/users/{userId}") void deleteUserAccount(@PathVariable Integer userId);  }### Answer:
@Test @Order(3) public void insertUser() throws Exception { String url = "/signup"; User newUser = new User("testspring", "test@spring", "test", "spring", "secret1!"); String json = mapper.writeValueAsString(newUser); mvc.perform( MockMvcRequestBuilders.post(url) .content(json) .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(jsonPath("$.username").value("testspring")) .andExpect(jsonPath("$.email").value("test@spring")) .andExpect(jsonPath("$.firstname").value("test")) .andExpect(jsonPath("$.lastname").value("spring")) .andExpect(jsonPath("$.country").value(IsNull.nullValue())) .andExpect(jsonPath("$.isAdmin").value(false)) .andExpect(jsonPath("$.numProjects").value(0)); }