Class MockVoBuilder
Provides a mock entity value object creation service for unit testing.
- Since:
- 5.0.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreate a test form entity with a random name.createForm
(String clientName, String formName, String portalName) Create a test form entity with the given name.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.Create an Job with a status of 'In Progress'.createJobInProgressWithXml
(String formXmlData) Create an Job with a status of 'In Progress', and a start submission with the given form XML data.com.avoka.fc.core.entity.Portal
Create a test portal with a random name;com.avoka.fc.core.entity.Portal
createPortal
(String portalName) Create a test portal for a given name.Create a completed transaction entity with the given form.createTxnCompletedWithFormAndXml
(Form form, String formXmlData) Create a completed transaction entity with the given form and XML form data.createTxnCompletedWithXml
(String formXmlData) Create a completed transaction entity with the given XML form data.createTxnDeliveryReadyWithXml
(String formXmlData) Create a completed transaction entity with the given form and XML form data.Create a opened transaction entity.createTxnSavedWithXml
(String formXmlData) Create a saved transaction entity with the given XML form data.createTxnSavedWithXml
(String clientName, String formXmlData) Create a saved transaction entity with the given XML form data and Client Name.Create a submitted transaction entity with the given form.createTxnSubmittedWithFormAndXml
(Form form, String formXmlData) Create a submitted transaction entity with the given form and XML form data.createTxnSubmittedWithXml
(String formXmlData) Create a submitted transaction entity with the given XML form data.createTxnTaskWithXml
(String formXmlData) Create an assigned Submission form task entity with the given XML form data.createTxnTaskWithXml
(String clientName, String formXmlData) Create an assigned Submission form task entity with the given XML and client name.Create a local type user with a random login name.Create a SSO type user with a random login name.com.avoka.fc.core.entity.Client
Get or create a test client.com.avoka.fc.core.entity.Client
getOrCreateClient
(String clientName) Get or create a client for a given name
-
Constructor Details
-
MockVoBuilder
public MockVoBuilder()
-
-
Method Details
-
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
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
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
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 clientformXmlData
- the form XML data for the transaction- Returns:
- a saved transaction entity with the given XML form data
-
createTxnTaskWithXml
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
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 clientformXmlData
- the form XML data for the transaction- Returns:
- a assigned task transaction value object
-
createTxnSubmittedWithXml
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
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
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
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
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
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
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
Create an Job with a status of 'In Progress'.- Returns:
- a new Job with a status of 'In Progress'
-
createJobInProgressWithXml
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
Get or create a client for a given name- Parameters:
clientName
- Name of client- Returns:
- a test client
-
createPortal
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
Create a test form entity with a random name.- Returns:
- test form entity with a random name.
-
createForm
Create a test form entity with the given name.- Parameters:
clientName
- Client Name (Required)formName
- Form NameportalName
- Portal Name- Returns:
- test form entity.
-
createUserLocal
Create a local type user with a random login name.- Returns:
- local type user with a random login name
-
createUserSso
Create a SSO type user with a random login name.- Returns:
- SSO type user with a random login name
-