Examples of LdapSchemaTemplateListResponse


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

  public void testLoading()
      throws Exception
  {
    PlexusResource pr = this.lookup(PlexusResource.class, "LdapSchemaTempleListPlexusResource");

    LdapSchemaTemplateListResponse templateResponse = (LdapSchemaTemplateListResponse) pr.get(null, null, null, null);

    List<LdapSchemaTemplateDTO> templates = templateResponse.getData();

    Assert.assertNotNull(templates);
    Assert.assertEquals(4, templates.size());

    // get the 2nd one and validate it
View Full Code Here

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

  }

  @Test
  public void testTemplates() {

    LdapSchemaTemplateListResponse resource = new LdapSchemaTemplateListResponse();
    // LdapServerConfigurationDTO dto = new LdapServerConfigurationDTO();
    resource.setData(new ArrayList<LdapSchemaTemplateDTO>());

    LdapSchemaTemplateDTO template1Dto = new LdapSchemaTemplateDTO();
    resource.getData().add(template1Dto);
    template1Dto.setName("name");
    template1Dto.setUserAndGroupConfig(new LdapUserAndGroupAuthConfigurationDTO());
    template1Dto.getUserAndGroupConfig().setUserSubtree(true);

    validateMarshalAndUnmarchal(resource);
View Full Code Here

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

  public LdapSchemaTemplateListResponse get(Context context, Request request, Response response, Variant variant)
      throws ResourceException
  {
    List<LdapSchemaTemplate> templates = this.templateManager.getSchemaTemplates();

    LdapSchemaTemplateListResponse templateResponse = new LdapSchemaTemplateListResponse();
    templateResponse.setData(new ArrayList<LdapSchemaTemplateDTO>());

    for (LdapSchemaTemplate ldapSchemaTemplate : templates) {
      LdapSchemaTemplateDTO dto = new LdapSchemaTemplateDTO();
      dto.setName(ldapSchemaTemplate.getName());
      dto.setUserAndGroupConfig(this.toDto(ldapSchemaTemplate.getUserAndGroupAuthConfig()));
      templateResponse.getData().add(dto);
    }

    return templateResponse;
  }
View Full Code Here

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

      String responseText = response.getEntity().getText();

      Assert.assertEquals("Response text:\n" + responseText, 200, response.getStatus().getCode());

      // make sure we have the correct number of templates
      LdapSchemaTemplateListResponse templateResponse = this.getFromResponse(
          LdapSchemaTemplateListResponse.class,
          this.getXMLXStream(),
          responseText);
      Assert.assertEquals(4, templateResponse.getData().size());
    }
    finally {
      RequestFacade.releaseResponse(response);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.