/** {@inheritDoc} */ @Test public void testSingleElementUnmarshall() { NewEncryptedID encElement = (NewEncryptedID) unmarshallElement(singleElementFile); Assert.assertNotNull(encElement); Assert.assertNull(encElement.getEncryptedData(), "EncryptedData child element"); Assert.assertEquals(encElement.getEncryptedKeys().size(), 0, "# of EncryptedKey children"); }
/** {@inheritDoc} */ @Test public void testChildElementsUnmarshall() { NewEncryptedID encElement = (NewEncryptedID) unmarshallElement(childElementsFile); Assert.assertNotNull(encElement, "NewEncryptedID was null"); Assert.assertNotNull(encElement.getEncryptedData(), "EncryptedData child element"); Assert.assertEquals( encElement.getEncryptedKeys().size(), encryptedKeyCount, "# of EncryptedKey children"); }
/** {@inheritDoc} */ @Test public void testChildElementsMarshall() { NewEncryptedID encElement = (NewEncryptedID) buildXMLObject(NewEncryptedID.DEFAULT_ELEMENT_NAME); encElement.setEncryptedData((EncryptedData) buildXMLObject(EncryptedData.DEFAULT_ELEMENT_NAME)); for (int i = 0; i < encryptedKeyCount; i++) { encElement .getEncryptedKeys() .add((EncryptedKey) buildXMLObject(EncryptedKey.DEFAULT_ELEMENT_NAME)); } assertXMLEquals(expectedChildElementsDOM, encElement); }