Package com.sonatype.security.ldap.api.dto

Examples of com.sonatype.security.ldap.api.dto.LdapUserListResponse


    userGroupDto.setLdapGroupsAsRoles(true);

    Request request = new Request();
    Response response = new Response(request);

    LdapUserListResponse userListResponse = (LdapUserListResponse) pr.put(
        null,
        request,
        response,
        ldapServerRequest);

    Assert.assertEquals(3, userListResponse.getData().size());

    // build a nice little map so we can test things without a else if
    Map<String, LdapUserDTO> userMap = new HashMap<String, LdapUserDTO>();
    for (LdapUserDTO user : userListResponse.getData()) {
      userMap.put(user.getUserId(), user);
    }

    // now check everybody
    LdapUserDTO cstamas = userMap.get("cstamas");
View Full Code Here


            new XStreamRepresentation(xstream,
                xstream.toXML(serverRequest),
                MediaType.APPLICATION_XML),
            respondsWithStatusCode(200));

    LdapUserListResponse listResponse = this.getFromResponse(LdapUserListResponse.class, xstream,
        responseText);

    assertThat(listResponse.getData(), hasSize(4));

    // and make sure everyone has groups except "jdcasey"
    for (LdapUserDTO userDto : listResponse.getData()) {
      if (!"jdcasey".equals(userDto.getUserId())) {
        assertThat(userDto.getRoles(), not(Matchers.<String>empty()));
      }
    }
  }
View Full Code Here

    if (!validationResponse.isValid()) {
      throw new InvalidConfigurationException(validationResponse);
    }

    // its valid, now we need to deal with getting the users
    LdapUserListResponse result = new LdapUserListResponse();
    try {
      // get the users
      SortedSet<LdapUser> ldapUsers = ldapConnectionTester.testUserAndGroupMapping(
          buildDefaultLdapContextFactory(ldapServer.getId(), ldapServer.getConnectionInfo()),
          LdapConnectionUtils.getLdapAuthConfiguration(ldapServer),
          20
      );

      // now add them to the result
      for (LdapUser ldapUser : ldapUsers) {
        result.getData().add(this.toDto(ldapUser));
      }

    }
    catch (MalformedURLException e) {
      getLogger().debug("LDAP Realm is not configured correctly: " + e.getMessage(), e);
View Full Code Here

TOP

Related Classes of com.sonatype.security.ldap.api.dto.LdapUserListResponse

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.