@Test
public void testCreateElementForExternalContainmentType() throws Exception {

    Payload partInfo = new Payload();
    addOptionalAttributesToPartInfo(partInfo);
    // check attachment
    partInfo.setContainment(IPayload.Containment.EXTERNAL);
    String payloadURI = "path_to_file";
    partInfo.setPayloadURI(payloadURI);
    OMElement piElement = PartInfoElement.createElement(plElement, partInfo);
    assertNotNull(piElement);
    // check the presence of the href attribute
    assertEquals(payloadURI,
            piElement.getAttribute(new QName("href")).getAttributeValue());
    checkPresenceOfOptionalOMElements(piElement);
}