Class MockVoBuilder


  • public class MockVoBuilder
    extends Object

    Provides a mock entity value object creation service for unit testing.

    Since:
    5.0.0
    • Constructor Detail

      • MockVoBuilder

        public MockVoBuilder()
    • Method Detail

      • createFuncParam

        public FuncParam createFuncParam​(String triggerType,
                                         String formStatus,
                                         SvcDef svcDef,
                                         Map<String,​String> testParams)

        Creates a FuncParam with the given trigger type, transaction form status, service definition and test parameters. This method will also create the following FuncParam attributes:

        • trigger - using provided trigger type
        • appDoc - document using the svcDef 'Test XML Data'
        • params - empty parameters map
        • request - mock request object
        • svcDef - using the provided service definition
        • txn - with "Saved" form status
        • user - null user object
        Parameters:
        triggerType - the function trigger type (required)
        formStatus - the transaction form status (required)
        svcDef - the associated service definition (required)
        testParams - the unit test parameters (optional)
        Returns:
        a function parameter object
        Since:
        17.10.3
      • createTxnOpened

        public Txn createTxnOpened()
        Create a opened transaction entity. This is useful for mocking up Dynamic Data calls. The transaction record will have the status values:
         Form Status:     Opened
         Receipt Status:  null
         Delivery Status: Not Ready
         
        Returns:
        a opened transaction value object
      • createTxnSavedWithXml

        public Txn createTxnSavedWithXml​(String formXmlData)
        Create a saved transaction entity with the given XML form data. The transaction record will have the status values:
         Form Status:     Saved
         Receipt Status:  null
         Delivery Status: Not Ready
         
        Parameters:
        formXmlData - the form XML data for the transaction
        Returns:
        a saved transaction entity with the given XML form data
      • createTxnSavedWithXml

        public Txn createTxnSavedWithXml​(String clientName,
                                         String formXmlData)
        Create a saved transaction entity with the given XML form data and Client Name. The transaction record will have the status values:
         Form Status:     Saved
         Receipt Status:  null
         Delivery Status: Not Ready
         
        Parameters:
        clientName - Name of client
        formXmlData - the form XML data for the transaction
        Returns:
        a saved transaction entity with the given XML form data
      • createTxnTaskWithXml

        public Txn createTxnTaskWithXml​(String formXmlData)
        Create an assigned Submission form task entity with the given XML form data. The transaction record will have the status values:
         Form Status:     Assigned
         Task Type:       Form
         Receipt Status:  null
         Delivery Status: Not Ready
         
        Parameters:
        formXmlData - the form XML data for the transaction
        Returns:
        a assigned task transaction value object
      • createTxnTaskWithXml

        public Txn createTxnTaskWithXml​(String clientName,
                                        String formXmlData)
        Create an assigned Submission form task entity with the given XML and client name. The transaction record will have the status values:
             Form Status:     Assigned
             Task Type:       Form
             Receipt Status:  null
             Delivery Status: Not Ready
         
        Parameters:
        clientName - Name of client
        formXmlData - the form XML data for the transaction
        Returns:
        a assigned task transaction value object
      • createTxnSubmittedWithXml

        public Txn createTxnSubmittedWithXml​(String formXmlData)
        Create a submitted transaction entity with the given XML form data. The transaction record will have the status values:
         Form Status:     Submitted
         Receipt Status:  null
         Delivery Status: Not Ready
         
        Parameters:
        formXmlData - the form XML data for the transaction
        Returns:
        a completed transaction value object
      • createTxnSubmittedWithFormAndXml

        public Txn createTxnSubmittedWithFormAndXml​(Form form,
                                                    String formXmlData)

        Create a submitted transaction entity with the given form and XML form data. The transaction record will have the status values:

         Form Status:     Completed
         Receipt Status:  null
         Delivery Status: Not Ready
         

        If the form has form data extract mappings configured, then submission data extracts will be created against the transaction.

        Parameters:
        form - the transaction form (required)
        formXmlData - the form XML data for the transaction (required)
        Returns:
        a completed transaction value object
        Since:
        5.0.0
      • createTxnSubmittedWithFormAndXml

        public Txn createTxnSubmittedWithFormAndXml​(Form form)

        Create a submitted transaction entity with the given form. The transaction record will have the status values:

         Form Status:     Completed
         Receipt Status:  null
         Delivery Status: Not Ready
         

        If the form has form data extract mappings configured, then submission data extracts will be created against the transaction.

        Parameters:
        form - the transaction form (required)
        Returns:
        a completed transaction value object
        Since:
        5.1.0
      • createTxnCompletedWithXml

        public Txn createTxnCompletedWithXml​(String formXmlData)
        Create a completed transaction entity with the given XML form data. The transaction record will have the status values:
         Form Status:     Completed
         Receipt Status:  Ready
         Delivery Status: Not Ready
         
        Parameters:
        formXmlData - the form XML data for the transaction
        Returns:
        a completed transaction value object
      • createTxnCompletedWithFormAndXml

        public Txn createTxnCompletedWithFormAndXml​(Form form,
                                                    String formXmlData)
        Create a completed transaction entity with the given form and XML form data. The transaction record will have the status values:
         Form Status:     Completed
         Receipt Status:  null
         Delivery Status: Not Ready
         

        If the form has form data extract mappings configured, then submission data extracts will be created against the transaction.

        Parameters:
        form - the transaction form (required)
        formXmlData - the form XML data for the transaction (required)
        Returns:
        a completed transaction value object
      • createTxnCompletedWithFormAndXml

        public Txn createTxnCompletedWithFormAndXml​(Form form)
        Create a completed transaction entity with the given form. The transaction record will have the status values:
         Form Status:     Completed
         Receipt Status:  null
         Delivery Status: Not Ready
         

        If the form has form data extract mappings configured, then submission data extracts will be created against the transaction.

        Parameters:
        form - the transaction form (required)
        Returns:
        a completed transaction value object
        Since:
        5.1.0
      • createTxnDeliveryReadyWithXml

        public Txn createTxnDeliveryReadyWithXml​(String formXmlData)
        Create a completed transaction entity with the given form and XML form data. The transaction record will have the status values:
         Form Status:     Completed
         Receipt Status:  Completed
         Delivery Status: Ready
         
        Parameters:
        formXmlData - the form XML data for the transaction
        Returns:
        a completed transaction value object
      • createJobInProgress

        public Job createJobInProgress()
        Create an Job with a status of 'In Progress'.
        Returns:
        a new Job with a status of 'In Progress'
      • createJobInProgressWithXml

        public Job createJobInProgressWithXml​(String formXmlData)
        Create an Job with a status of 'In Progress', and a start submission with the given form XML data.
        Parameters:
        formXmlData - the form XML data for the transaction (required)
        Returns:
        a new Job with a status of 'In Progress'
      • getOrCreateClient

        public com.avoka.fc.core.entity.Client getOrCreateClient()
        Get or create a test client.
        Returns:
        a test client.
      • getOrCreateClient

        public com.avoka.fc.core.entity.Client getOrCreateClient​(String clientName)
        Get or create a client for a given name
        Parameters:
        clientName - Name of client
        Returns:
        a test client
      • createPortal

        public com.avoka.fc.core.entity.Portal createPortal​(String portalName)
        Create a test portal for a given name.
        Parameters:
        portalName - Portal name.
        Returns:
        a test portal.
      • createPortal

        public com.avoka.fc.core.entity.Portal createPortal()
        Create a test portal with a random name;
        Returns:
        a test portal.
      • createForm

        public Form createForm()
        Create a test form entity with a random name.
        Returns:
        test form entity with a random name.
      • createForm

        public Form createForm​(String clientName,
                               String formName,
                               String portalName)
        Create a test form entity with the given name.
        Parameters:
        clientName - Client Name (Required)
        formName - Form Name
        portalName - Portal Name
        Returns:
        test form entity.
      • createUserLocal

        public User createUserLocal()
        Create a local type user with a random login name.
        Returns:
        local type user with a random login name
      • createUserSso

        public User createUserSso()
        Create a SSO type user with a random login name.
        Returns:
        SSO type user with a random login name