@Test @WithMockUser public void testUserDetails() throws Exception { OAuth2Authentication oAuth2Authentication = mock(OAuth2Authentication.class); SecureUser secureUser = new SecureUser(getUser()); when(oAuth2Authentication.getPrincipal()).thenReturn(secureUser); when(tokenService.getUser("c80e0ade-f48d-4077-b0d2-4e58526a6bfd")) .thenReturn(getCustomUserDetails()); mockMvc.perform(post("/_details?access_token=c80e0ade-f48d-4077-b0d2-4e58526a6bfd")) .andExpect(status().isOk()) .andExpect(content().json(getFileContents("userDetailsResponse.json"))); }
@PostMapping("/_details") public CustomUserDetails getUser(@RequestParam(value = "access_token") String accessToken) { final UserDetail userDetail = tokenService.getUser(accessToken); return new CustomUserDetails(userDetail); }
UserController { @PostMapping("/_details") public CustomUserDetails getUser(@RequestParam(value = "access_token") String accessToken) { final UserDetail userDetail = tokenService.getUser(accessToken); return new CustomUserDetails(userDetail); } }
UserController { @PostMapping("/_details") public CustomUserDetails getUser(@RequestParam(value = "access_token") String accessToken) { final UserDetail userDetail = tokenService.getUser(accessToken); return new CustomUserDetails(userDetail); } @Autowired  UserController(UserService userService, TokenService tokenService); }
UserController { @PostMapping("/_details") public CustomUserDetails getUser(@RequestParam(value = "access_token") String accessToken) { final UserDetail userDetail = tokenService.getUser(accessToken); return new CustomUserDetails(userDetail); } @Autowired  UserController(UserService userService, TokenService tokenService); @PostMapping("/citizen/_create") Object createCitizen(@RequestBody CreateUserRequest createUserRequest); @PostMapping("/users/_createnovalidate") UserDetailResponse createUserWithoutValidation(@RequestBody CreateUserRequest createUserRequest,
			@RequestHeader HttpHeaders headers); @PostMapping("/_search") UserSearchResponse get(@RequestBody UserSearchRequest request, @RequestHeader HttpHeaders headers); @PostMapping("/v1/_search") UserSearchResponse getV1(@RequestBody UserSearchRequest request, @RequestHeader HttpHeaders headers); @PostMapping("/_details") CustomUserDetails getUser(@RequestParam(value = "access_token") String accessToken); @PostMapping("/users/_updatenovalidate") UserDetailResponse updateUserWithoutValidation(@RequestBody final CreateUserRequest createUserRequest,
														  @RequestHeader HttpHeaders headers); @PostMapping("/profile/_update") UserDetailResponse patch(@RequestBody final CreateUserRequest createUserRequest); }
UserController { @PostMapping("/_details") public CustomUserDetails getUser(@RequestParam(value = "access_token") String accessToken) { final UserDetail userDetail = tokenService.getUser(accessToken); return new CustomUserDetails(userDetail); } @Autowired  UserController(UserService userService, TokenService tokenService); @PostMapping("/citizen/_create") Object createCitizen(@RequestBody CreateUserRequest createUserRequest); @PostMapping("/users/_createnovalidate") UserDetailResponse createUserWithoutValidation(@RequestBody CreateUserRequest createUserRequest,
			@RequestHeader HttpHeaders headers); @PostMapping("/_search") UserSearchResponse get(@RequestBody UserSearchRequest request, @RequestHeader HttpHeaders headers); @PostMapping("/v1/_search") UserSearchResponse getV1(@RequestBody UserSearchRequest request, @RequestHeader HttpHeaders headers); @PostMapping("/_details") CustomUserDetails getUser(@RequestParam(value = "access_token") String accessToken); @PostMapping("/users/_updatenovalidate") UserDetailResponse updateUserWithoutValidation(@RequestBody final CreateUserRequest createUserRequest,
														  @RequestHeader HttpHeaders headers); @PostMapping("/profile/_update") UserDetailResponse patch(@RequestBody final CreateUserRequest createUserRequest);  }