Package com.avoka.fc.core.service.test
Class MockEntityUtils
- java.lang.Object
-
- com.avoka.fc.core.service.BaseService
-
- com.avoka.fc.core.service.CayenneService
-
- com.avoka.fc.core.service.test.MockEntityUtils
-
public class MockEntityUtils extends CayenneService
This is an internal utility class providing common methods for unit tests. This class is not a part of the public TM API and is not guaranteed to remain compatible across releases.- Since:
- 18.11.0
-
-
Constructor Summary
Constructors Constructor Description MockEntityUtils()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SubmissionProperty
addSearchableSubmissionProperty(Submission submission, String name, String value)
Stores a submission property (encrypted) and adds a submission property search entry.SubmissionGroup
addSubmissionToGroup(Submission submission, Group group)
Create a submission group association.DeliveryDetails
createDeliveryDetails(Client client, String name, String method)
Create a basic delivery channel for the given client.DeploymentProperty
createDeploymentProperty(String propertyName, String type, String value)
Create a deployment property with the given name, type and value.Attachment
createElectronicAttachment(Submission submission, String fileName, byte[] fileData, String fileUploadType)
Create a basic delivery channel for the given client.org.apache.click.servlet.MockRequest
createMockRequest(String loginName, Portal portal)
Creates a MockRequest for the given loginname and portal.PortalPage
createPortalPage(Portal portal, String name, String path)
void
setupRemoteUserProvider(HttpServletRequest request)
This is taken from the RemoteUserFilter, it sets up the remoteUserProvider correctly for a give request.getRemoteUser()void
storeSubmissionDataExtracts(Submission submission, Map<String,String> dataExtractMap)
Stores a submission property (encrypted) and adds a submission property search entry.-
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
-
-
-
-
Method Detail
-
addSubmissionToGroup
public SubmissionGroup addSubmissionToGroup(Submission submission, Group group)
Create a submission group association. This method performs a DB commit and clears the cache.- Parameters:
submission
- the submission (required)group
- the group (required)- Returns:
- the submission group
- Since:
- 18.11.0
-
addSearchableSubmissionProperty
public SubmissionProperty addSearchableSubmissionProperty(Submission submission, String name, String value)
Stores a submission property (encrypted) and adds a submission property search entry.
-
storeSubmissionDataExtracts
public void storeSubmissionDataExtracts(Submission submission, Map<String,String> dataExtractMap)
Stores a submission property (encrypted) and adds a submission property search entry.
-
createPortalPage
public PortalPage createPortalPage(Portal portal, String name, String path)
-
createDeliveryDetails
public DeliveryDetails createDeliveryDetails(Client client, String name, String method)
Create a basic delivery channel for the given client. The caller needs to fill in additional fields based on delivery method (e.g. delivery process name)- Parameters:
client
- the client (required)name
- the name (required, must be unique for the client)method
- (required)- Returns:
- the committed DeliveryDetails object
- Since:
- 20.05.0
-
createElectronicAttachment
public Attachment createElectronicAttachment(Submission submission, String fileName, byte[] fileData, String fileUploadType)
Create a basic delivery channel for the given client. The caller needs to fill in additional fields based on delivery method (e.g. delivery process name)- Parameters:
submission
- the submission (required)fileName
- the attachment file name (required)fileData
- (required) the attachment file data (required)fileUploadType
- (required) one ofFileUpload.TYPES
- Returns:
- the committed Attachment object with associated FileUpload
- Since:
- 20.05.0
-
createDeploymentProperty
public DeploymentProperty createDeploymentProperty(String propertyName, String type, String value)
Create a deployment property with the given name, type and value. This method does not check if such a deployment property already exists.- Parameters:
propertyName
- the deployment property name (required)type
- the type (required; one of the types defined inDeploymentProperty
)value
- the value (optional)- Returns:
- the deployment property
- Since:
- 19.11.3
-
setupRemoteUserProvider
public void setupRemoteUserProvider(HttpServletRequest request)
This is taken from the RemoteUserFilter, it sets up the remoteUserProvider correctly for a give request.getRemoteUser()- Parameters:
request
- the mock HttpServletRequest containing the remote user attribute- Since:
- 20.5.0
-
createMockRequest
public org.apache.click.servlet.MockRequest createMockRequest(String loginName, Portal portal)
Creates a MockRequest for the given loginname and portal.- Parameters:
loginName
- the user login name String to be used buy request.getRemoteUser()portal
- the Portal to associate the request to.- Returns:
- a MockRequest for the given login name and portal.
-
-