@Test
  public void testLdapUserAndGroupConfigTestRequest() throws Exception {
    LdapUserAndGroupConfigTestRequest resource = new LdapUserAndGroupConfigTestRequest();
    LdapUserAndGroupConfigTestRequestDTO dto = new LdapUserAndGroupConfigTestRequestDTO();

    resource.setData(dto);

    dto.setAuthScheme("authScheme");
    dto.setHost("host");
    dto.setPort(123);
    dto.setProtocol("protocol");
    dto.setRealm("realm");
    dto.setSearchBase("searchBase");
    dto.setSystemPassword("systemPassword");
    dto.setSystemUsername("systemUsername");
    dto.setUserMemberOfAttribute("userMemberOfAttribute");
    dto.setEmailAddressAttribute("emailAddressAttribute");
    dto.setGroupBaseDn("groupBaseDn");
    dto.setGroupIdAttribute("groupIdAttribute");
    dto.setGroupMemberFormat("groupMemberFormat");
    dto.setGroupMemberAttribute("groupMemberAttribute");
    dto.setGroupMemberFormat("groupMemberFormat");
    dto.setGroupObjectClass("groupObjectClass");
    dto.setUserBaseDn("userBaseDn");
    dto.setUserIdAttribute("userIdAttribute");
    dto.setUserObjectClass("userObjectClass");
    dto.setUserPasswordAttribute("userPasswordAttribute");
    dto.setUserRealNameAttribute("userRealNameAttribute");
    dto.setUserSubtree(true);

    validateXmlHasNoPackageNames(resource);
  }
  @Test
  public void testLdapUserAndGroupConfigTestRequestWithEscape() throws Exception {
    LdapUserAndGroupConfigTestRequest resource = new LdapUserAndGroupConfigTestRequest();
    LdapUserAndGroupConfigTestRequestDTO dto = new LdapUserAndGroupConfigTestRequestDTO();

    resource.setData(dto);

    dto.setAuthScheme("authScheme&");
    dto.setHost("host&");
    dto.setPort(123);
    dto.setProtocol("protocol&");
    dto.setRealm("realm&");
    dto.setSearchBase("searchBase&");
    dto.setSystemPassword("systemPassword&");
    dto.setSystemUsername("systemUsername&");
    dto.setUserMemberOfAttribute("userMemberOfAttribute&");
    dto.setEmailAddressAttribute("emailAddressAttribute&");
    dto.setGroupBaseDn("groupBaseDn&");
    dto.setGroupIdAttribute("groupIdAttribute&");
    dto.setGroupMemberFormat("groupMemberFormat&");
    dto.setGroupMemberAttribute("groupMemberAttribute&");
    dto.setGroupMemberFormat("groupMemberFormat&");
    dto.setGroupObjectClass("groupObjectClass&");
    dto.setUserBaseDn("userBaseDn&");
    dto.setUserIdAttribute("userIdAttribute&");
    dto.setUserObjectClass("userObjectClass&");
    dto.setUserPasswordAttribute("userPasswordAttribute&");
    dto.setUserRealNameAttribute("userRealNameAttribute&");
    dto.setLdapFilter("ldapFilter&");
    dto.setUserSubtree(true);

    validateXmlHasNoPackageNames(resource);

    String xml = this.xstreamXML.toXML(resource);
    LdapUserAndGroupConfigTestRequestDTO result =
        ((LdapUserAndGroupConfigTestRequest) this.xstreamXML.fromXML(xml)).getData();

    Assert.assertEquals(result.getSearchBase(), "searchBase&");
    Assert.assertEquals(result.getSystemPassword(), "systemPassword&");
    Assert.assertEquals(result.getSystemUsername(), "systemUsername&");
    Assert.assertEquals(result.getGroupMemberFormat(), "groupMemberFormat&");
    Assert.assertEquals(result.getGroupBaseDn(), "groupBaseDn&");
    Assert.assertEquals(result.getUserBaseDn(), "userBaseDn&");
    Assert.assertEquals(result.getLdapFilter(), "ldapFilter&");

    Assert.assertEquals(result.getAuthScheme(), "authScheme&");
    Assert.assertEquals(result.getHost(), "host&");
    Assert.assertEquals(result.getPort(), 123);
    Assert.assertEquals(result.getProtocol(), "protocol&");
    Assert.assertEquals(result.getRealm(), "realm&");
    Assert.assertEquals(result.getUserMemberOfAttribute(), "userMemberOfAttribute&");
    Assert.assertEquals(result.getEmailAddressAttribute(), "emailAddressAttribute&");
    Assert.assertEquals(result.getGroupIdAttribute(), "groupIdAttribute&");
    Assert.assertEquals(result.getGroupMemberAttribute(), "groupMemberAttribute&");
    Assert.assertEquals(result.getGroupObjectClass(), "groupObjectClass&");
    Assert.assertEquals(result.getUserIdAttribute(), "userIdAttribute&");
    Assert.assertEquals(result.getUserObjectClass(), "userObjectClass&");
    Assert.assertEquals(result.getUserPasswordAttribute(), "userPasswordAttribute&");
    Assert.assertEquals(result.getUserRealNameAttribute(), "userRealNameAttribute&");
    Assert.assertEquals(result.isUserSubtree(), true);
  }