@Test
public void testGetElements() throws Exception {

    ErrorMessage errorMessage = new ErrorMessage();
    ArrayList<IEbmsError> errors = new ArrayList<>();
    EbmsError ebmsError = new EbmsError();
    ebmsError.setCategory("");
    ebmsError.setSeverity(IEbmsError.Severity.failure);
    ebmsError.setErrorCode("some_error_code");
    errors.add(ebmsError);
    errorMessage.setErrors(errors);
    ErrorSignalElement.createElement(headerBlock, errorMessage);
    Iterator<OMElement> it = ErrorSignalElement.getElements(headerBlock);
    assertTrue(it.hasNext());
    OMElement esElement = it.next();
    assertEquals(SIGNAL_MESSAGE_ELEMENT_NAME, esElement.getQName());
    OMElement eElement =
            (OMElement)esElement.getChildrenWithName(ERROR_ELEMENT_NAME).next();
    assertEquals(ERROR_ELEMENT_NAME, eElement.getQName());
    assertEquals(IEbmsError.Severity.failure.toString(),
            eElement.getAttributeValue(SEVERITY_ATTR_NAME));
    assertEquals("some_error_code",
            eElement.getAttributeValue(ERROR_CODE_ATTR_NAME));
}