use of com.zimbra.soap.admin.type.GranteeInfo in project zm-mailbox by Zimbra.
the class TestDelegatedDL method getDistributionListAdmin.
/*
* Test the owners element in zimbraAdmin:GetDistributionList
*/
@Test
public void getDistributionListAdmin() throws Exception {
SoapTransport transport = authAdmin(ADMIN);
com.zimbra.soap.admin.message.GetDistributionListRequest req = new com.zimbra.soap.admin.message.GetDistributionListRequest(com.zimbra.soap.admin.type.DistributionListSelector.fromName(DL_NAME));
com.zimbra.soap.admin.message.GetDistributionListResponse resp = invokeJaxb(transport, req);
com.zimbra.soap.admin.type.DistributionListInfo dlInfo = resp.getDl();
String dlId = dlInfo.getId();
Group group = prov.getGroup(Key.DistributionListBy.name, DL_NAME);
assertNotNull(group);
assertEquals(group.getId(), dlId);
/*
System.out.println("\nAttrs:");
List<com.zimbra.soap.admin.type.Attr> attrs = dlInfo.getAttrList();
for (com.zimbra.soap.admin.type.Attr attr : attrs) {
System.out.println(attr.getN() + ", " + attr.getValue());
}
*/
List<GranteeInfo> dlOwners = dlInfo.getOwners();
assertEquals(1, dlOwners.size());
for (GranteeInfo owner : dlOwners) {
com.zimbra.soap.type.GranteeType type = owner.getType();
String id = owner.getId();
String name = owner.getName();
assertEquals(com.zimbra.soap.type.GranteeType.usr, type);
assertEquals(USER_OWNER, name);
}
}
Aggregations