Package com.avoka.fc.core.service.test
Class MockEntityService
java.lang.Object
com.avoka.fc.core.service.BaseService
com.avoka.fc.core.service.CayenneService
com.avoka.fc.core.service.test.MockEntityService
Provides service to generate persistent TM entities for use in Groovy Unit Tests.
- Since:
- 4.3.0
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddCategoryToVersion
(TemplateVersion formVersion, Category category) Add a category to a form version.addClientToPortal
(Client client, Portal portal) Add a client to the specified portal This method does NOT check if the portal already has that client.addClientToUser
(UserAccount userAccount, Client client) Add a client to the specified user account This method does NOT check if the user already has that client.void
addFormToGroup
(Form form, Group group) Add a form to a group.addPortalPermission
(String permissionName, Portal portal) Add a permission for a portal, if it doesn't already exist.addPortalToUser
(UserAccount userAccount, Portal portal) Add a portal to the specified user account This method does NOT check if the user already has that portal.addRoleToUser
(UserAccount userAccount, Role role, Date roleExpiryDatetime) Add a role to a user, with an optional expiry time.addUserToGroup
(Group group, UserAccount userAccount, Date expiryDatetime) Create a user group association.createApplicationPackage
(String name, Client client) Create an application package with the given name and clientcreateCategory
(Client client, String name, String description) Create a category.createClient
(String name) Create a client with the given name.createClient
(String name, String code) Create a client with the given name and code.createClientProperty
(Client client, PropertyType propertyType, String value) Create a client property value for a client and property type.createDataExtractMapping
(SchemaSeed schemaSeed, String name, String xpath, int sequenceNumber) Create a data extract mapping for the given schema seed.Create a default data retention management service.void
createDeploymentProperty
(String propertyName, Boolean isSet) Create a boolean DeploymentProperty.createEmailQueue
(String fromAddress, String toAddress, String subject, String body, String plainBody, Portal portal) create an EmailQueue objectcreate a default unit test email queue service (EmailQueueServiceImpl).Create a default unit test email service (TrashCanEmailService).Create a mock ErrorLog.createEventConfigurationService
(String eventConfiguration, ServiceConnection sc) Return a default event configuration service.createEventListenerConfigurationService
(ServiceConnection sc, String topics, int numberOfListeners, int numberOfProcessingThreads, long pollTimeoutMillis) Return an EventListenerConfigurationService service.createEventLog
(Submission submission) Create a mock EventLog.createForm
(String formCode, Client client, Portal portal) Create a new form with the given formCode, client and portal.createForm
(String formCode, Client client, Collection<Portal> portals) Create a new form with the given formCode, client and portal.createFormGroup
(String name) Create a new form group with the given name.createGroovyServiceLog
(Client client, Submission submission, ServiceDefinition serviceDefinition, ErrorLog errorLog) Create a mock GroovyServiceLog for the given parameters.createGroup
(String name, String type) Create a new group with the given name and type.createJobGroup
(String name) Create a new job group with the given name.createJobInProgress
(Client client) Create an Job for the given client with an 'In Progress' status.createJobInProgress
(Client client, String formXml) Create an Job for the given client with an 'In Progress' status.createJobServiceDefinition
(Client client, String svcName, String svcVersion) Create JobController Service DefinitioncreateJobWithFormXml
(Client client, String jobDefJson, Form form, String formXmlData) Create a mock collaboration job for the given jobDefinition and ClientcreateJobWithGroupInProgress
(Client client, String formXml) Create a Job with a group for the given client with an 'In Progress' status.createJobWithSubmission
(Client client, String jobDefJson, Submission submission) Create a mock collaboration job for the given jobDefinition and ClientcreateKafkaServiceConnection
(String name, String kafkaServer, String userName, String pass, Client client, String jsonConfig) Create a new Kafka Service ConnectionCreate a payment log entity.createPermission
(String permissionName, Portal portal) Create a permission with the given name and portal.createPortal
(String name) Create forms Portal with the given name and of type 'Web Plugin'.createPortalProperty
(Portal portal, String name, String dataType, String value) Create a portal property value.createProject
(Client client, String name) Create project with given name for a client.createPropertyType
(String name, String scope, String dataType, Client client) Create a property type, optionally associated with a clientcreateRequest
(Submission submission) Create a mock request for the given submission object.createRole
(String roleName, Set<Permission> permissionSet) Create an active role with the given name and permissions.Create a default local Security Manager entity.Create a new ServerNodecreateServiceConnection
(String name, String serverType, Client client) Create a new Service ConnectioncreateServiceDefinition
(String name, String versionNumber, String serviceType, String className, Client client) Create an active service definition with the given name, version number, type, class and optionally client This method sets the active flag and potentially the current version flag (if no other version of the same service exists) Other settings have to be set on the service definition after creation, e.g.createServiceParameter
(ServiceDefinition serviceDefinition, String name, String type, boolean bindParameterFlag, boolean unitTestFlag, String value) Create a service parametercreateSubmissionCompletedWithFormAndXml
(Form form, String formXmlData) Create a completed Submission entity with the given form and XML form data.createSubmissionCompletedWithXml
(String formXmlData) Create a completed Submission entity with the given XML form data.createSubmissionCompletedWithXml
(String formXmlData, Client client) Create a completed Submission entity with the given XML form data and client.createSubmissionDataBean
(String formXmlData) Create a SubmissionDataBean from the given form XML data.Create a default database submission data storage service.createSubmissionDeliveryReadyWithFormAndXml
(Form form, String formXmlData) Create a completed Submission entity with the given form and XML form data.createSubmissionDeliveryReadyWithXml
(String formXmlData) Create a completed Submission entity with the given form and XML form data.createSubmissionEventOutbox
(ServiceConnection serviceConnection, UserAccount userAccount) Create a mock EventOutbox.Create a opened Submission entity.createSubmissionOpened
(Client client) Create a opened Submission entity with the given client.createSubmissionProperty
(Submission submission, String name, String value) Create a non-encrypted submission property.createSubmissionSavedWithXml
(String formXmlData) Create a saved Submission entity with the given XML form data.createSubmissionSavedWithXml
(String formXmlData, Client client) Create a saved Submission entity with the given XML form data and client.createSubmissionSubmittedWithFormAndXml
(Form form, String formXmlData) Create a submitted Submission entity with the given form and XML form data.createSubmissionSubmittedWithXml
(String formXmlData) Create a submitted Submission entity with the given XML form data.createSubmissionSubmittedWithXml
(String formXmlData, Client client) Create a submitted Submission entity with the given XML form data and client.createSubmissionTaskWithXml
(String formXmlData) Create an assigned Submission form task entity with the given XML form data.createSubmissionTaskWithXml
(String formXmlData, Client client) Create an assigned Submission form task entity with the given XML form data and client.createSubmissionTaskWithXml
(String formXmlData, Form form) Create an assigned Submission form task entity with the given XML form data and form The submission record will have the status values:createSubmissionWithClientStatusXml
(Client client, String formStatus, String formXmlData) Create a Submission entity with the given client, form status and XML form data.createSubmissionWithStatusesAndXml
(Form form, String formStatus, String receiptStatus, String deliveryStatus, String formXmlData) Create a mock request for the given submission object.createTPac
(String projectCode, Client client) Create a tpac with the given code and clientCreate a default tracking number service.Create a test local user with a random login name.createUserLocal
(Portal portal) Create a test local user with a random login name.createUserProperty
(UserProfile userProfile, PropertyType propertyType, String value) Create a user property value for a user profile and property type.Create a test SSO user account with a random login name.createUserSso
(String loginName, Portal portal) Creates a SSO user with a given loginName and portalcreateVersionProperty
(TemplateVersion version, PropertyType propertyType, String value) Create a version property value for a form version and property type.getOrCreateClient
(String testName) Get the current client if executing in GroovyScript Unit Test context with a client defined, or create a new test client otherwise.grantFormPortalAccess
(Form form, Portal portal, boolean allowAnonymousAccess, boolean allowAuthenticatedAccess) Creates or updates the form portal association and sets the anonymous/authenticated access flags as specified.Load core server configuration for standalone build time JUnit Testing.loadCoreConfiguration
(String password) Load core server configuration for standalone build time JUnit Testing.Set the form to be used when creating submission entities.setFormHttpApi2
(boolean formHttpApi2) Set the form template version to use the Form HTTP API 2.setFormType
(String formType) Set the form type.Set the portal to be used when creating submission entities.setTestName
(String testName) Set the test name used for creating entities.Methods inherited from class com.avoka.fc.core.service.CayenneService
commitChanges, deleteObject, deleteObjects, findObject, getDataContext, getDataDomain, getObjectForPK, getObjectStore, newObject, performNamedQuery, performNamedQuery, performNamedQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performQuery, performQuery, refetchEntity, refetchObject, registerNewObject, rollbackChanges, toMap, toMap
Methods inherited from class com.avoka.fc.core.service.BaseService
getLogger
-
Field Details
-
FORM_XML
Mock Form XML data.- See Also:
-
USER_AGENT_FIREFOX
Mock User-Agent header.- See Also:
-
-
Constructor Details
-
MockEntityService
public MockEntityService()
-
-
Method Details
-
setFormType
Set the form type.- Parameters:
formType
- the form type- Returns:
- the mock entity service
- Since:
- 17.10.0
-
setForm
Set the form to be used when creating submission entities.- Parameters:
form
- the form record- Returns:
- the mock entity service
- Since:
- 17.10.0
-
setFormHttpApi2
Set the form template version to use the Form HTTP API 2.- Parameters:
formHttpApi2
- specify whether to use the Form HTTP API 2- Returns:
- the mock entity service
- Since:
- 17.10.0
-
setPortal
Set the portal to be used when creating submission entities.- Parameters:
portal
- the portal record- Returns:
- the mock entity service
- Since:
- 17.10.0
-
setTestName
Set the test name used for creating entities.- Parameters:
testName
- the test name used for creating entities- Returns:
- the mock entity service
- Since:
- 17.10.0
-
createProject
Create project with given name for a client.- Parameters:
client
- clientname
- project name- Returns:
- project with given name for a client
- Since:
- 17.10.0
-
createPortal
Create forms Portal with the given name and of type 'Web Plugin'.- Parameters:
name
- the name of the portal- Returns:
- forms Portal with the given name and of type 'Web Plugin'
-
createClient
Create a client with the given name.- Parameters:
name
- the name of the client.- Returns:
- a client with the given name
-
createClient
Create a client with the given name and code.- Parameters:
name
- the name of the client.code
- the code of the client.- Returns:
- a client with the given name and code
- Since:
- 5.1.4
-
getOrCreateClient
Get the current client if executing in GroovyScript Unit Test context with a client defined, or create a new test client otherwise.- Parameters:
testName
- the test name for the client- Returns:
- a existing client or create a new test client
- Since:
- 5.1.7
-
createCategory
Create a category.- Parameters:
client
- the client (required)name
- the name (required)description
- the description (optional)- Returns:
- the category
- Since:
- 18.11.0
-
addCategoryToVersion
Add a category to a form version.- Parameters:
formVersion
- the form version (required)category
- the category (required)- Returns:
- the form category
- Since:
- 18.11.0
-
createPropertyType
Create a property type, optionally associated with a client- Parameters:
name
- the property namescope
- the scope (e.g. PropertyType.SCOPE_Client)dataType
- the data type (e.g. PropertyType.DATA_TYPE_String)client
- the client that the property type belongs to (optional)- Returns:
- the property type
-
createClientProperty
Create a client property value for a client and property type.- Parameters:
client
- the client (required)propertyType
- the property type (required)value
- the value- Returns:
- the client property value
-
createPortalProperty
public PortalProperty createPortalProperty(Portal portal, String name, String dataType, String value) Create a portal property value.- Parameters:
portal
- the portal (required)name
- the property name (required)dataType
- the data type (required)value
- the value- Returns:
- the portal property value
- Since:
- 5.1.4
-
createVersionProperty
public VersionPropertyValue createVersionProperty(TemplateVersion version, PropertyType propertyType, String value) Create a version property value for a form version and property type. Note that this method doesn't support properties without an associated property type.- Parameters:
version
- the form version (required)propertyType
- the property type (required)value
- the value- Returns:
- the version property value
-
createUserProperty
public UserProperty createUserProperty(UserProfile userProfile, PropertyType propertyType, String value) Create a user property value for a user profile and property type.- Parameters:
userProfile
- the user profile (required)propertyType
- the property type (required)value
- the value- Returns:
- the user property value
-
createApplicationPackage
Create an application package with the given name and client- Parameters:
name
- the application nameclient
- the owning client- Returns:
- a new application package
-
createTPac
Create a tpac with the given code and client- Parameters:
projectCode
- the project codeclient
- the owning client- Returns:
- a new manage package
- Since:
- 17.10.0
-
createServiceDefinition
public ServiceDefinition createServiceDefinition(String name, String versionNumber, String serviceType, String className, Client client) Create an active service definition with the given name, version number, type, class and optionally client This method sets the active flag and potentially the current version flag (if no other version of the same service exists) Other settings have to be set on the service definition after creation, e.g. type default flag, service connection and parameters.- Parameters:
name
- the name (required)versionNumber
- the version number (required)serviceType
- the service type (required)className
- the class that the service is based on (required)client
- the client (optional)- Returns:
- the service definition
- Since:
- 5.1.7
-
createServiceParameter
public ServiceParameter createServiceParameter(ServiceDefinition serviceDefinition, String name, String type, boolean bindParameterFlag, boolean unitTestFlag, String value) Create a service parameter- Parameters:
serviceDefinition
- the service that the parameter belongs to (required)name
- the parameter name (required)type
- the data type (required)bindParameterFlag
- whether the parameter should be bound to an attribute on the service classunitTestFlag
- whether the parameter is related to unit testingvalue
- the parameter value (optional)- Returns:
- the service parameter
- Since:
- 17.10.0
-
createForm
Create a new form with the given formCode, client and portal.- Parameters:
formCode
- the form codeclient
- the owning clientportal
- the associated portal- Returns:
- a new form with the given formCode, client and portal
-
createForm
Create a new form with the given formCode, client and portal. Note: This method will create a ClientPortal for any portals not already associated with the client.- Parameters:
formCode
- the form code (required)client
- the owning client (required)portals
- the portals (required)- Returns:
- a new form with the given formCode, client and portal
- Since:
- 18.5.0
-
createDataExtractMapping
public SchemaExtractMap createDataExtractMapping(SchemaSeed schemaSeed, String name, String xpath, int sequenceNumber) Create a data extract mapping for the given schema seed.- Parameters:
schemaSeed
- the schema seed (required)name
- the name (required)xpath
- the XPath (required)sequenceNumber
- the sequence number (required)- Returns:
- the data extract mapping
- Since:
- 18.11.0
-
createFormGroup
Create a new form group with the given name. The created form group will have the following access control policies:Form Work Group: true Completed Form: true New Form: true Saved Form: true Task Assign: true
- Parameters:
name
- the group name- Returns:
- a new form group with the given name.
- Since:
- 4.3.4
-
createGroovyServiceLog
public GroovyServiceLog createGroovyServiceLog(Client client, Submission submission, ServiceDefinition serviceDefinition, ErrorLog errorLog) Create a mock GroovyServiceLog for the given parameters.- Parameters:
client
- the test client (required)submission
- the submission object (required)errorLog
- the errorLog- Returns:
- groovyServiceLog the groovyServiceLog
- Since:
- 22.04.0
-
createJobGroup
Create a new job group with the given name.- Parameters:
name
- the group name- Returns:
- a new job group with the given name.
- Since:
- 17.10.0
-
createGroup
Create a new group with the given name and type.- Parameters:
name
- the group name (required)type
- the group type (required)- Returns:
- a new group with the given name and type.
- Since:
- 18.11.0
-
addUserToGroup
Create a user group association.- Parameters:
group
- the group (required)userAccount
- the user (required)expiryDatetime
- the time at which the group association will become invalid (optional)- Returns:
- the user group
- Since:
- 18.11.0
-
createPaymentLog
Create a payment log entity.- Parameters:
sub
- the submission record (required)- Returns:
- a peyment log entity
- Since:
- 19.5.0
-
createSecurityManager
Create a default local Security Manager entity.- Returns:
- a default local Security Manager entity
-
createSubmissionDataBean
Create a SubmissionDataBean from the given form XML data. A backing submission record will be created with the status values:Form Status: Submitted Receipt Status: null Delivery Status: Not Ready
- Parameters:
formXmlData
- the submission form XML data (required)- Returns:
- a SubmissionDataBean
-
createSubmissionOpened
Create a opened Submission entity. This is useful for mocking up Dynamic Data calls. The submission record will have the status values:Form Status: Opened Receipt Status: null Delivery Status: Not Ready
- Returns:
- a opened Submission entity
-
createSubmissionOpened
Create a opened Submission entity with the given client. This is useful for mocking up Dynamic Data calls. The submission record will have the status values:Form Status: Opened Receipt Status: null Delivery Status: Not Ready
- Parameters:
client
- the test client (required)- Returns:
- a opened Submission entity
- Since:
- 5.0.0
-
createSubmissionSavedWithXml
Create a saved Submission entity with the given XML form data. The submission record will have the status values:Form Status: Saved Receipt Status: null Delivery Status: Not Ready
- Parameters:
formXmlData
- the form XML data for the submission (required)- Returns:
- a saved Submission entity with the given XML form data
-
createSubmissionSavedWithXml
Create a saved Submission entity with the given XML form data and client. The submission record will have the status values:Form Status: Saved Receipt Status: null Delivery Status: Not Ready
- Parameters:
formXmlData
- the form XML data for the submission (required)client
- the test client (required)- Returns:
- a saved Submission entity with the given XML form data
- Since:
- 5.0.0
-
createSubmissionTaskWithXml
Create an assigned Submission form task entity with the given XML form data. The submission 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 submission (required)- Returns:
- a assigned Submission form task entity with the given XML form data
- Since:
- 4.3.4
-
createSubmissionTaskWithXml
Create an assigned Submission form task entity with the given XML form data and form The submission 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 submission (required)form
- the form associated with the submission (required)- Returns:
- an assigned Submission form task entity with the given XML form data and form
- Since:
- 22.4.0
-
createSubmissionTaskWithXml
Create an assigned Submission form task entity with the given XML form data and client. The submission 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 submission (required)client
- the test client (required)- Returns:
- a assigned Submission form task entity with the given XML form data
- Since:
- 5.0.0
-
createSubmissionSubmittedWithXml
Create a submitted Submission entity with the given XML form data. The submission record will have the status values:Form Status: Submitted Receipt Status: null Delivery Status: Not Ready
- Parameters:
formXmlData
- the form XML data for the submission (required)- Returns:
- a completed Submission entity with the given XML form data
-
createSubmissionSubmittedWithXml
Create a submitted Submission entity with the given XML form data and client. The submission record will have the status values:Form Status: Submitted Receipt Status: null Delivery Status: Not Ready
- Parameters:
formXmlData
- the form XML data for the submission (required)client
- the test client (required)- Returns:
- a completed Submission entity with the given XML form data
-
createSubmissionSubmittedWithFormAndXml
Create a submitted Submission entity with the given form and XML form data. The submission record will have the status values:Form Status: Submitted 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 submission.- Parameters:
form
- the form associated with the submission (required)formXmlData
- the form XML data for the submission (required)- Returns:
- a submitted Submission entity with the given XML form data
- Since:
- 5.0.0
-
createSubmissionCompletedWithXml
Create a completed Submission entity with the given XML form data. The submission record will have the status values:Form Status: Completed Receipt Status: Ready Delivery Status: Not Ready
- Parameters:
formXmlData
- the form XML data for the submission (required)- Returns:
- a completed Submission entity with the given XML form data
-
createSubmissionCompletedWithXml
Create a completed Submission entity with the given XML form data and client. The submission record will have the status values:Form Status: Completed Receipt Status: Ready Delivery Status: Not Ready
- Parameters:
formXmlData
- the form XML data for the submission (required)client
- the test client (required)- Returns:
- a completed Submission entity with the given XML form data
- Since:
- 5.0.0
-
createSubmissionWithClientStatusXml
public Submission createSubmissionWithClientStatusXml(Client client, String formStatus, String formXmlData) Create a Submission entity with the given client, form status and XML form data.- Parameters:
client
- the test client (required)formStatus
- the submission form status (required)formXmlData
- the form XML data for the submission (required)- Returns:
- the new submission
- Since:
- 17.10.3
-
createSubmissionCompletedWithFormAndXml
Create a completed Submission entity with the given form and XML form data. The submission record will have the status values:Form Status: Completed Receipt Status: Ready Delivery Status: Not Ready
If the form has form data extract mappings configured, then submission data extracts will be created against the submission.- Parameters:
form
- the form associated with the submission (required)formXmlData
- the form XML data for the submission (required)- Returns:
- a completed Submission entity with the given XML form data
-
createSubmissionDeliveryReadyWithXml
Create a completed Submission entity with the given form and XML form data. The submission record will have the status values:Form Status: Completed Receipt Status: Completed Delivery Status: Ready
- Parameters:
formXmlData
- the form XML data for the submission (required)- Returns:
- a completed Submission entity with the given XML form data
-
createSubmissionDeliveryReadyWithFormAndXml
Create a completed Submission entity with the given form and XML form data. The submission record will have the status values:Form Status: Completed Receipt Status: Completed Delivery Status: Ready
If the form has form data extract mappings configured, then submission data extracts will be created against the submission.- Parameters:
form
- the form associated with the submission (required)formXmlData
- the form XML data for the submission (required)- Returns:
- a completed Submission entity with the given XML form data
-
createSubmissionProperty
public SubmissionProperty createSubmissionProperty(Submission submission, String name, String value) Create a non-encrypted submission property.- Parameters:
submission
- the submission (required)name
- the property name (required)value
- the property value (optional)- Returns:
- the submission property
- Since:
- 18.11.0
-
createSubmissionDataStorageService
Create a default database submission data storage service.- Returns:
- a default database submission data storage service
-
createUserLocal
Create a test local user with a random login name.- Returns:
- a new a test local user with a random login name.
- Since:
- 5.0.0
-
createUserLocal
Create a test local user with a random login name.- Parameters:
portal
- the portal to assign to the user.- Returns:
- a new a test local user with a random login name.
- Since:
- 17.10.0
-
createUserSso
Create a test SSO user account with a random login name.- Returns:
- a new a test SSO user account with a random login name.
- Since:
- 5.0.0
-
createUserSso
Creates a SSO user with a given loginName and portal- Parameters:
loginName
- the login name for the userportal
- the portal to assign to the user- Returns:
- the created SSO user
- Since:
- 17.10.0
-
addClientToUser
Add a client to the specified user account This method does NOT check if the user already has that client.- Parameters:
userAccount
- the user account (required)client
- the client (required)- Returns:
- the new ClientUser object
-
addClientToPortal
Add a client to the specified portal This method does NOT check if the portal already has that client.- Parameters:
client
- the client (required)portal
- the portal (required)- Returns:
- the new ClientPortal object
- Since:
- 17.10.0
-
addPortalToUser
Add a portal to the specified user account This method does NOT check if the user already has that portal.- Parameters:
userAccount
- the user account (required)portal
- the portal (required)- Returns:
- the new PortalUser object
- Since:
- 5.1.4
-
createJobInProgress
Create an Job for the given client with an 'In Progress' status.- Parameters:
client
- the client owning the job (required)- Returns:
- the job entity
-
createJobInProgress
Create an Job for the given client with an 'In Progress' status.- Parameters:
client
- the client owning the job (required)formXml
- the form XML data of the job start transaction (optional)- Returns:
- the job entity
- Since:
- 17.10.4
-
createJobWithGroupInProgress
Create a Job with a group for the given client with an 'In Progress' status.- Parameters:
client
- the client owning the job (required)formXml
- the form XML data of the job start transaction (optional)- Returns:
- the job entity
- Since:
- 21.11.0
-
createJobWithFormXml
Create a mock collaboration job for the given jobDefinition and Client- Parameters:
client
- the Client owning the job (required)jobDefJson
- the job definition as a JSON Stringform
- the mock Form entityformXmlData
- the form XML (String)- Returns:
- the created job entity
- Since:
- 17.10.0
-
createJobWithSubmission
Create a mock collaboration job for the given jobDefinition and Client- Parameters:
client
- the Client owning the job (required)jobDefJson
- the job definition as a JSON Stringsubmission
- the Jobs start submission- Returns:
- the created job entity
- Since:
- 17.10.0
-
createJobServiceDefinition
public ServiceDefinition createJobServiceDefinition(Client client, String svcName, String svcVersion) Create JobController Service Definition- Parameters:
client
- the Client owning the job (required)svcName
- the service name (required)svcVersion
- the service version (required)- Returns:
- the jobControllerService if the jobDefJson
- Since:
- 18.11.0
-
createTrackingNumberServie
Create a default tracking number service.- Returns:
- a default tracking number service
-
createEventConfigurationService
public ServiceDefinition createEventConfigurationService(String eventConfiguration, ServiceConnection sc) Return a default event configuration service.- Parameters:
eventConfiguration
- the eventConfiguration (required)sc
- the service connection entity (required)- Returns:
- a default event configuration service
- Since:
- 23.10.0
-
createEventListenerConfigurationService
public ServiceDefinition createEventListenerConfigurationService(ServiceConnection sc, String topics, int numberOfListeners, int numberOfProcessingThreads, long pollTimeoutMillis) Return an EventListenerConfigurationService service.- Parameters:
sc
- the service connection entity (required)topics
- List of topics in json formatnumberOfListeners
- The number of threads should be set to listen to the topicsnumberOfProcessingThreads
- The number of threads which process stream records- Returns:
- a default event listener configuration service
- Since:
- 24.4.0
-
createDataRetentionManagementService
Create a default data retention management service.- Returns:
- a default data retention management service
-
createEmailService
Create a default unit test email service (TrashCanEmailService).- Returns:
- a unit test email service
- Since:
- 5.0.0
-
createEmailQueueService
create a default unit test email queue service (EmailQueueServiceImpl).- Returns:
- a unit test email queue service
- Since:
- 22.4.0
-
loadCoreConfiguration
Load core server configuration for standalone build time JUnit Testing. IMPORTANT NOTE this method should not be called in a running TM server.- Returns:
- this mock entity service
-
loadCoreConfiguration
Load core server configuration for standalone build time JUnit Testing. IMPORTANT NOTE this method should not be called in a running TM server.- Parameters:
password
- the default admin password- Returns:
- this mock entity service
- Since:
- 22.10.0
-
createErrorLog
Create a mock ErrorLog.- Returns:
- ErrorLog the mock ErrorLog
- Since:
- 22.04.0
-
createEventLog
Create a mock EventLog.- Parameters:
submission
- the submission object (required)- Returns:
- eventLog the mock eventLog
- Since:
- 22.04.0
-
createSubmissionEventOutbox
public EventOutbox createSubmissionEventOutbox(ServiceConnection serviceConnection, UserAccount userAccount) Create a mock EventOutbox.- Parameters:
serviceConnection
- the service connectionuserAccount
- the user account- Returns:
- eventOutbox the mock EventOutbox
- Since:
- 22.10.0
-
createRandomTestName
- Returns:
- a random test name.
- Since:
- 5.0.0
-
createRequest
Create a mock request for the given submission object.- Parameters:
submission
- the submission object (required)- Returns:
- a mock HTTP request object
- Since:
- 17.10.0
-
createSubmissionWithStatusesAndXml
public Submission createSubmissionWithStatusesAndXml(Form form, String formStatus, String receiptStatus, String deliveryStatus, String formXmlData) Create a mock request for the given submission object.- Parameters:
form
- the form to create the submission formformStatus
- the submission formStatusreceiptStatus
- the submission receiptStatusdeliveryStatus
- the submission deliveryStatusformXmlData
- the submission formXmlData- Returns:
- a mock submission
- Since:
- 17.10.4
-
createDeploymentProperty
Create a boolean DeploymentProperty.- Parameters:
propertyName
- the name of the deployment propertyisSet
- the boolean value to set the property with.- Since:
- 17.10.0
-
addPortalPermission
Add a permission for a portal, if it doesn't already exist.- Parameters:
permissionName
- the permission name (required)portal
- the portal (required)- Returns:
- the permission
- Since:
- 17.10.6
-
addRoleToUser
Add a role to a user, with an optional expiry time. No validation is done as to whether the role is already assigned.- Parameters:
userAccount
- the user (required)role
- the role (required)roleExpiryDatetime
- the expiry date/time (optional)- Returns:
- the newly created user role
- Since:
- 17.10.6
-
addFormToGroup
Add a form to a group. No validation is done on whether the form already has the group.- Parameters:
form
- the form (required)group
- the group (required)
-
createRole
Create an active role with the given name and permissions.- Parameters:
roleName
- the role name (required)permissionSet
- the set of permissions to include (can be empty but not null)- Returns:
- the new role
- Since:
- 17.10.6
-
grantFormPortalAccess
public FormPortal grantFormPortalAccess(Form form, Portal portal, boolean allowAnonymousAccess, boolean allowAuthenticatedAccess) Creates or updates the form portal association and sets the anonymous/authenticated access flags as specified. After this method completes, the form will be associated with the portal (it does not matter if that was the case previously). Note: This may also add the portal to the client, if necessary.- Parameters:
form
- the form (required)portal
- the portal (required)allowAnonymousAccess
- whether to grant access to anonymous usersallowAuthenticatedAccess
- whether to grant access to authenticated users- Returns:
- the form portal entity
- Since:
- 18.11.0
-
createPermission
Create a permission with the given name and portal.- Parameters:
permissionName
- the permission name (required)portal
- the portal (required)- Returns:
- the new permission
- Since:
- 18.11.0
-
createServiceConnection
Create a new Service Connection- Parameters:
name
- the service connection nameserverType
- the serverType valueclient
- the client owning the service connection (Optional)- Returns:
- the new Service Connection
- Since:
- 22.04.0
-
createKafkaServiceConnection
public ServiceConnection createKafkaServiceConnection(String name, String kafkaServer, String userName, String pass, Client client, String jsonConfig) Create a new Kafka Service Connection- Parameters:
name
- the service connection namekafkaServer
- the Kafka bootstrap server valueuserName
- the usernamepass
- the passwordclient
- the client owning the service connection (Optional)- Returns:
- the new Service Connection
- Since:
- 22.10.0
-
createServerNode
Create a new ServerNode- Returns:
- ServerNode the new ServerNode object
- Since:
- 22.04.0
-
createEmailQueue
public EmailQueue createEmailQueue(String fromAddress, String toAddress, String subject, String body, String plainBody, Portal portal) create an EmailQueue object- Parameters:
fromAddress
- the fromAddress of emailtoAddress
- the toAddress of emailsubject
- the subject of emailbody
- the body of emailplainBody
- the plainBody of emailportal
- the associated portal- Returns:
- an EmailQueue object
- Since:
- 22.04.0
-