@Test public void basic() throws Exception { Instant createTime = ZonedDateTime.of(2015, 3, 4, 23, 5, 6, 7, ZoneId.of("Asia/Taipei")) .toInstant(); Account account = Account.create("user1", "user1@example.com", "pwd", createTime); when(accountService.findMe(isA(ClientAppUserAccessToken.class))).thenReturn(Optional.of(account)); oauthPerform(account, get("/v1/user/basic")).andExpect(status().isOk()) .andExpect(jsonPath("$.data.username", is("user1"))) .andExpect(jsonPath("$.data.createTime", is("2015-03-04T15:05:06Z"))); }
@ApiOperation(value = "[user] Get my basic information", notes = "Get authorized user basic information.") @RequiredScope(USER) @RequestMapping(value = "/basic", method = RequestMethod.GET) public V1UserBasicDto basic(ClientAppUserAccessToken accessToken) { Account account = accountService.findMe(accessToken).get(); return new V1UserBasicDto(account.getUsername(), account.getDescription(), Date.from(account.getCreateTime())); }
V1UserResource { @ApiOperation(value = "[user] Get my basic information", notes = "Get authorized user basic information.") @RequiredScope(USER) @RequestMapping(value = "/basic", method = RequestMethod.GET) public V1UserBasicDto basic(ClientAppUserAccessToken accessToken) { Account account = accountService.findMe(accessToken).get(); return new V1UserBasicDto(account.getUsername(), account.getDescription(), Date.from(account.getCreateTime())); } }
V1UserResource { @ApiOperation(value = "[user] Get my basic information", notes = "Get authorized user basic information.") @RequiredScope(USER) @RequestMapping(value = "/basic", method = RequestMethod.GET) public V1UserBasicDto basic(ClientAppUserAccessToken accessToken) { Account account = accountService.findMe(accessToken).get(); return new V1UserBasicDto(account.getUsername(), account.getDescription(), Date.from(account.getCreateTime())); }  }
V1UserResource { @ApiOperation(value = "[user] Get my basic information", notes = "Get authorized user basic information.") @RequiredScope(USER) @RequestMapping(value = "/basic", method = RequestMethod.GET) public V1UserBasicDto basic(ClientAppUserAccessToken accessToken) { Account account = accountService.findMe(accessToken).get(); return new V1UserBasicDto(account.getUsername(), account.getDescription(), Date.from(account.getCreateTime())); }  @ApiOperation(value = "[user] Get my basic information", notes = "Get authorized user basic information.") @RequiredScope(USER) @RequestMapping(value = "/basic", method = RequestMethod.GET) V1UserBasicDto basic(ClientAppUserAccessToken accessToken); @ApiOperation(value = "[public] Get basic information of the user", notes = "Get other user's basic information.") @RequiredScope(ClientAppScope.PUBLIC) @RequestMapping(value = "/{username}/basic", method = RequestMethod.GET) V1UserBasicDto basicByUsername(ClientAppUserAccessToken accessToken,
      @PathVariable("username") String username); }
V1UserResource { @ApiOperation(value = "[user] Get my basic information", notes = "Get authorized user basic information.") @RequiredScope(USER) @RequestMapping(value = "/basic", method = RequestMethod.GET) public V1UserBasicDto basic(ClientAppUserAccessToken accessToken) { Account account = accountService.findMe(accessToken).get(); return new V1UserBasicDto(account.getUsername(), account.getDescription(), Date.from(account.getCreateTime())); }  @ApiOperation(value = "[user] Get my basic information", notes = "Get authorized user basic information.") @RequiredScope(USER) @RequestMapping(value = "/basic", method = RequestMethod.GET) V1UserBasicDto basic(ClientAppUserAccessToken accessToken); @ApiOperation(value = "[public] Get basic information of the user", notes = "Get other user's basic information.") @RequiredScope(ClientAppScope.PUBLIC) @RequestMapping(value = "/{username}/basic", method = RequestMethod.GET) V1UserBasicDto basicByUsername(ClientAppUserAccessToken accessToken,
      @PathVariable("username") String username);  }