Class AbstractSoapAttachmentValidator

java.lang.Object
org.citrusframework.ws.validation.AbstractSoapAttachmentValidator
All Implemented Interfaces:
SoapAttachmentValidator
Direct Known Subclasses:
BinarySoapAttachmentValidator, SimpleSoapAttachmentValidator

public abstract class AbstractSoapAttachmentValidator extends Object implements SoapAttachmentValidator
Abstract SOAP attachment validator tries to find attachment within received message and compares its attachment contentId, contentType and content body to a control attachment definition. Validator will create a SoapAttachment and automatically handle contentId and contentType validation. Content body validation is delegated to subclasses.
Author:
Christoph Deppisch
  • Constructor Details

    • AbstractSoapAttachmentValidator

      public AbstractSoapAttachmentValidator()
  • Method Details

    • validateAttachment

      public void validateAttachment(SoapMessage soapMessage, List<SoapAttachment> controlAttachments)
      Description copied from interface: SoapAttachmentValidator
      Validate attachments in soap message. List of control attachments should be present and get validated.
      Specified by:
      validateAttachment in interface SoapAttachmentValidator
    • findAttachment

      protected SoapAttachment findAttachment(SoapMessage soapMessage, SoapAttachment controlAttachment)
      Finds attachment in list of soap attachments on incoming soap message. By default uses content id of control attachment as search key. If no proper attachment with this content id was found in soap message throws validation exception.
      Parameters:
      soapMessage -
      controlAttachment -
      Returns:
    • validateAttachmentContentId

      protected void validateAttachmentContentId(SoapAttachment receivedAttachment, SoapAttachment controlAttachment)
      Validating SOAP attachment content id.
      Parameters:
      receivedAttachment -
      controlAttachment -
    • validateAttachmentContentType

      protected void validateAttachmentContentType(SoapAttachment receivedAttachment, SoapAttachment controlAttachment)
      Validating SOAP attachment content type.
      Parameters:
      receivedAttachment -
      controlAttachment -
    • validateAttachmentContent

      protected abstract void validateAttachmentContent(SoapAttachment receivedAttachment, SoapAttachment controlAttachment)
      Delegate content body validation to subclasses.
      Parameters:
      receivedAttachment -
      controlAttachment -