Search in sources :

Example 1 with RenameDistributionListResponse

use of com.zimbra.soap.admin.message.RenameDistributionListResponse in project zm-mailbox by Zimbra.

the class TestDomainAdmin method testGetDistributionListInDomAdminDomain.

@Test
public void testGetDistributionListInDomAdminDomain() throws Exception {
    String domAdminId = createAdminConsoleStyleDomainAdmin(DOMADMIN);
    SoapProvisioning domAdminSoapProv = getSoapProvisioning(DOMADMIN, TestUtil.DEFAULT_PASSWORD);
    CreateDistributionListResponse caResp;
    caResp = domAdminSoapProv.invokeJaxb(new CreateDistributionListRequest(TARGET_DL));
    assertNotNull("CreateDistributionListResponse for " + TARGET_DL + " simple as domAdmin", caResp);
    String dlId = caResp.getDl().getId();
    GetDistributionListRequest getDlReq = new GetDistributionListRequest(DistributionListSelector.fromName(TARGET_DL));
    GetDistributionListResponse getDlResp = domAdminSoapProv.invokeJaxb(getDlReq);
    assertNotNull("GetDistributionListResponse for " + TARGET_DL + " simple as domAdmin", getDlResp);
    AddDistributionListAliasResponse aaaResp;
    aaaResp = domAdminSoapProv.invokeJaxb(new AddDistributionListAliasRequest(dlId, ALIAS_FOR_TARGET_DL));
    assertNotNull("AddDistributionListAliasResponse for " + TARGET_DL + " simple as domAdmin", aaaResp);
    RemoveDistributionListAliasResponse daaResp;
    daaResp = domAdminSoapProv.invokeJaxb(new RemoveDistributionListAliasRequest(dlId, ALIAS_FOR_TARGET_DL));
    assertNotNull("RemoveDistributionListAliasResponse for " + TARGET_DL + " simple as domAdmin", daaResp);
    RenameDistributionListResponse renAResp;
    renAResp = domAdminSoapProv.invokeJaxb(new RenameDistributionListRequest(dlId, TARGET_DL_RENAMED));
    assertNotNull("RenameDistributionListResponse for " + TARGET_DL + " simple as domAdmin", renAResp);
    DeleteDistributionListRequest delDLReq;
    DeleteDistributionListResponse delDlResp;
    delDLReq = new DeleteDistributionListRequest(null);
    try {
        delDlResp = domAdminSoapProv.invokeJaxb(delDLReq);
        fail("DeleteDistributionListRequest succeeded in spite of having no 'id' specified!!");
    } catch (SoapFaultException sfe) {
        checkSoapReason(sfe, "invalid request: missing required attribute: id");
    }
    delDLReq = new DeleteDistributionListRequest(dlId);
    delDlResp = domAdminSoapProv.invokeJaxb(delDLReq);
    assertNotNull("DeleteDistributionListResponse for " + TARGET_DL + " as domAdmin", delDlResp);
    try {
        getDlResp = domAdminSoapProv.invokeJaxb(getDlReq);
        fail("GetDistributionListRequest succeeded after delete!");
    } catch (SoapFaultException sfe) {
        checkSoapReason(sfe, "no such distribution list:");
    }
    try {
        getDlResp = domAdminSoapProv.invokeJaxb(new GetDistributionListRequest(DistributionListSelector.fromId(dlId)));
        fail("GetDistributionListRequest succeeded after delete!");
    } catch (SoapFaultException sfe) {
        // because by id not name
        checkSoapReason(sfe, "permission denied: can not access distribution list");
    }
}
Also used : GetDistributionListResponse(com.zimbra.soap.admin.message.GetDistributionListResponse) RemoveDistributionListAliasRequest(com.zimbra.soap.admin.message.RemoveDistributionListAliasRequest) AddDistributionListAliasRequest(com.zimbra.soap.admin.message.AddDistributionListAliasRequest) CreateDistributionListResponse(com.zimbra.soap.admin.message.CreateDistributionListResponse) GetDistributionListRequest(com.zimbra.soap.admin.message.GetDistributionListRequest) SoapFaultException(com.zimbra.common.soap.SoapFaultException) RemoveDistributionListAliasResponse(com.zimbra.soap.admin.message.RemoveDistributionListAliasResponse) RenameDistributionListResponse(com.zimbra.soap.admin.message.RenameDistributionListResponse) RenameDistributionListRequest(com.zimbra.soap.admin.message.RenameDistributionListRequest) CreateDistributionListRequest(com.zimbra.soap.admin.message.CreateDistributionListRequest) SoapProvisioning(com.zimbra.cs.account.soap.SoapProvisioning) DeleteDistributionListRequest(com.zimbra.soap.admin.message.DeleteDistributionListRequest) DeleteDistributionListResponse(com.zimbra.soap.admin.message.DeleteDistributionListResponse) AddDistributionListAliasResponse(com.zimbra.soap.admin.message.AddDistributionListAliasResponse) Test(org.junit.Test)

Example 2 with RenameDistributionListResponse

use of com.zimbra.soap.admin.message.RenameDistributionListResponse in project zm-mailbox by Zimbra.

the class TestJaxbProvisioning method doRenameDynamicGroupTest.

private void doRenameDynamicGroupTest(boolean isACLGroup, String displayName, String memberURL) throws ServiceException {
    List<Attr> attrs = Lists.newArrayList();
    attrs.add(new Attr("zimbraIsACLGroup", isACLGroup ? "TRUE" : "FALSE"));
    attrs.add(new Attr("zimbraMailStatus", "enabled"));
    attrs.add(new Attr("displayName", displayName));
    if (memberURL != null) {
        attrs.add(new Attr("memberURL", memberURL));
    }
    Domain dom = ensureDomainExists(testDlDomain);
    assertNotNull(String.format("Domain for %s", testDlDomain), dom);
    deleteDlIfExists(testDl);
    CreateDistributionListResponse cdlResp = prov.invokeJaxb(new CreateDistributionListRequest(testDl, attrs, true));
    assertNotNull("CreateDistributionListResponse", cdlResp);
    RenameDistributionListResponse rdlResp = prov.invokeJaxb(new RenameDistributionListRequest(cdlResp.getDl().getId(), testDlNewName));
    assertNotNull("RenameDistributionListResponse", rdlResp);
}
Also used : RenameDistributionListResponse(com.zimbra.soap.admin.message.RenameDistributionListResponse) RenameDistributionListRequest(com.zimbra.soap.admin.message.RenameDistributionListRequest) CreateDistributionListRequest(com.zimbra.soap.admin.message.CreateDistributionListRequest) CreateDistributionListResponse(com.zimbra.soap.admin.message.CreateDistributionListResponse) Domain(com.zimbra.cs.account.Domain) Attr(com.zimbra.soap.admin.type.Attr)

Aggregations

CreateDistributionListRequest (com.zimbra.soap.admin.message.CreateDistributionListRequest)2 CreateDistributionListResponse (com.zimbra.soap.admin.message.CreateDistributionListResponse)2 RenameDistributionListRequest (com.zimbra.soap.admin.message.RenameDistributionListRequest)2 RenameDistributionListResponse (com.zimbra.soap.admin.message.RenameDistributionListResponse)2 SoapFaultException (com.zimbra.common.soap.SoapFaultException)1 Domain (com.zimbra.cs.account.Domain)1 SoapProvisioning (com.zimbra.cs.account.soap.SoapProvisioning)1 AddDistributionListAliasRequest (com.zimbra.soap.admin.message.AddDistributionListAliasRequest)1 AddDistributionListAliasResponse (com.zimbra.soap.admin.message.AddDistributionListAliasResponse)1 DeleteDistributionListRequest (com.zimbra.soap.admin.message.DeleteDistributionListRequest)1 DeleteDistributionListResponse (com.zimbra.soap.admin.message.DeleteDistributionListResponse)1 GetDistributionListRequest (com.zimbra.soap.admin.message.GetDistributionListRequest)1 GetDistributionListResponse (com.zimbra.soap.admin.message.GetDistributionListResponse)1 RemoveDistributionListAliasRequest (com.zimbra.soap.admin.message.RemoveDistributionListAliasRequest)1 RemoveDistributionListAliasResponse (com.zimbra.soap.admin.message.RemoveDistributionListAliasResponse)1 Attr (com.zimbra.soap.admin.type.Attr)1 Test (org.junit.Test)1