Package org.springside.examples.showcase.webservice.soap.response.dto

Examples of org.springside.examples.showcase.webservice.soap.response.dto.UserDTO


   * 测试创建用户.
   */
  @Test
  public void createUser() {
    User user = UserData.randomUser();
    UserDTO userDTO = BeanMapper.map(user, UserDTO.class);

    IdResult response = accountWebServiceClient.createUser(userDTO);
    assertThat(response.getId()).isNotNull();
    GetUserResult response2 = accountWebServiceClient.getUser(response.getId());
    assertThat(response2.getUser().getLoginName()).isEqualTo(user.getLoginName());
View Full Code Here


   * 测试创建用户,使用错误的登录名.
   */
  @Test
  public void createUserWithInvalidLoginName() {
    User user = UserData.randomUser();
    UserDTO userDTO = BeanMapper.map(user, UserDTO.class);

    // 登录名为空
    userDTO.setLoginName(null);
    IdResult response = accountWebServiceClient.createUser(userDTO);
    assertThat(response.getCode()).isEqualTo(WSResult.PARAMETER_ERROR);

    // 登录名重复
    userDTO.setLoginName("user");
    response = accountWebServiceClient.createUser(userDTO);
    assertThat(response.getCode()).isEqualTo(WSResult.PARAMETER_ERROR);
  }
View Full Code Here

      User user = accountService.getUser(id);

      Validate.notNull(user, "用户不存在(id:" + id + ")");

      UserDTO dto = BeanMapper.map(user, UserDTO.class);
      result.setUser(dto);

      return result;

    } catch (IllegalArgumentException e) {
View Full Code Here

TOP

Related Classes of org.springside.examples.showcase.webservice.soap.response.dto.UserDTO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.