Package org.springside.examples.miniservice.ws.dto

Examples of org.springside.examples.miniservice.ws.dto.UserDTO


   */
  @Test
  public void createUser() {
    User user = AccountData.getRandomUser();

    UserDTO userDTO = new UserDTO();
    userDTO.setLoginName(user.getLoginName());
    userDTO.setName(user.getName());
    userDTO.setEmail(user.getEmail());

    RoleDTO roleDTO = new RoleDTO();
    roleDTO.setId(1L);
    userDTO.getRoleList().add(roleDTO);

    CreateUserResult result = userWebService.createUser(userDTO);

    assertEquals(WSResult.SUCCESS, result.getCode());
    assertNotNull(result.getUserId());
View Full Code Here


        address);

    GetAllUserResult result = userWebServiceCreated.getAllUser();

    assertTrue(result.getUserList().size() > 0);
    UserDTO adminUser = result.getUserList().get(0);
    assertEquals("admin", adminUser.getLoginName());
    assertEquals(2, adminUser.getRoleList().size());
  }
View Full Code Here

    }

    //获取用户
    try {
      User entity = accountManager.getInitedUser(id);
      UserDTO dto = dozer.map(entity, UserDTO.class);

      result.setUser(dto);
      return result;
    } catch (ObjectNotFoundException e) {
      String message = "用户不存在(id:" + id + ")";
View Full Code Here

    EasyMock.expect(mockAccountManager.getAllInitedUser()).andReturn(list);
    control.replay();

    GetAllUserResult result = userWebService.getAllUser();
    assertEquals(WSResult.SUCCESS, result.getCode());
    UserDTO dto = result.getUserList().get(0);
    assertEquals(user.getLoginName(), dto.getLoginName());
    assertEquals(user.getRoleList().get(0).getName(), dto.getRoleList().get(0).getName());
  }
View Full Code Here

TOP

Related Classes of org.springside.examples.miniservice.ws.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.