Search in sources :

Example 1 with CheckDeviceStatusResponse

use of com.zimbra.soap.mail.message.CheckDeviceStatusResponse in project zm-mailbox by Zimbra.

the class OctopusJaxbTest method checkDeviceStatusResponse.

/**
     * Validating that method used to create response in CheckDeviceStatus
     * should work.
     * @throws Exception
     */
@Test
public void checkDeviceStatusResponse() throws Exception {
    IdStatus idStatus = IdStatus.fromIdAndStatus("idString", "statusString");
    CheckDeviceStatusResponse resp = new CheckDeviceStatusResponse(idStatus);
    Element response = JaxbUtil.jaxbToElement(resp, XMLElement.mFactory);
    Assert.assertNotNull("response object", response);
    resp = JaxbUtil.elementToJaxb(response);
    Assert.assertEquals("round tripped id", "idString", resp.getDevice().getId());
    Assert.assertEquals("round tripped status", "statusString", resp.getDevice().getStatus());
}
Also used : XMLElement(com.zimbra.common.soap.Element.XMLElement) Element(com.zimbra.common.soap.Element) JSONElement(com.zimbra.common.soap.Element.JSONElement) IdStatus(com.zimbra.soap.mail.type.IdStatus) CheckDeviceStatusResponse(com.zimbra.soap.mail.message.CheckDeviceStatusResponse) Test(org.junit.Test)

Aggregations

Element (com.zimbra.common.soap.Element)1 JSONElement (com.zimbra.common.soap.Element.JSONElement)1 XMLElement (com.zimbra.common.soap.Element.XMLElement)1 CheckDeviceStatusResponse (com.zimbra.soap.mail.message.CheckDeviceStatusResponse)1 IdStatus (com.zimbra.soap.mail.type.IdStatus)1 Test (org.junit.Test)1