Package com.adobe.cq.testing.client
Class CQWorkflowClient
java.lang.Object
org.apache.sling.testing.clients.AbstractSlingClient
org.apache.sling.testing.clients.SlingClient
com.adobe.cq.testing.client.CQClient
com.adobe.cq.testing.client.WorkflowClient
com.adobe.cq.testing.client.CQWorkflowClient
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.http.client.HttpClient
Extends the Granite Workflow client with CQ Specific Workflow methods
-
Nested Class Summary
Nested classes/interfaces inherited from class com.adobe.cq.testing.client.WorkflowClient
WorkflowClient.Status
Nested classes/interfaces inherited from class com.adobe.cq.testing.client.CQClient
CQClient.Builder, CQClient.InternalBuilder<T extends CQClient>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
Fields inherited from class com.adobe.cq.testing.client.WorkflowClient
MANAGE_WF_ENGINE_PATH, MANAGE_WF_INBOX_PATH, MANAGE_WF_INSTANCES_PATH, MANAGE_WF_MODELS_PATH, MODEL_DESCR_TYPE_JSON, MODEL_LIST_TYPE_ID, MODEL_LIST_TYPE_URI, PAYLOAD_TYPE_JCR, PAYLOAD_TYPE_URL
Fields inherited from class com.adobe.cq.testing.client.CQClient
LOG, STATISTICS_ROOT, wcmCommands
Fields inherited from class org.apache.sling.testing.clients.SlingClient
CLIENT_CONNECTION_TIMEOUT_PROP, DEFAULT_NODE_TYPE, SUDO_COOKIE_NAME
-
Constructor Summary
ConstructorDescriptionCQWorkflowClient
(URI serverUrl, String user, String password) CQWorkflowClient
(org.apache.http.impl.client.CloseableHttpClient http, org.apache.sling.testing.clients.SlingClientConfig config) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.sling.testing.clients.SlingHttpResponse
createNewModelPage
(String modelName, String modelTitle, int... expectedStatusRange) Creates a new Model page in the default directory "/etc/workflow/models/".void
createWorkflowLauncher
(String workflowId, String path, String nodeType, EventType eventType) Adds a new workflow launcher.void
editWorkflowLauncher
(String launcherId, String propName, String value) Edit one property of an existing workflow launcher identified by the launcher configuration namevoid
editWorkflowLauncher
(String launcherId, Map<String, String> propMap) Edit an existing workflow launcher identified by the launcher configuration name with a set of properties to changevoid
enableDisableWorkflowLauncher
(String launcherId, boolean enabled) Enables or disables the workflow launchergetWorkflowLauncher
(String launcherId) Returns aMap
with properties of the workflow launcherboolean
isWorkflowTransient
(String workflowModel) Finds out if the Transient feature flag is enabled for a workflow.org.apache.sling.testing.clients.SlingHttpResponse
Saves a model.Methods inherited from class com.adobe.cq.testing.client.WorkflowClient
abortWorkflow, advanceWorkItem, approveAndAdvanceWorkItem, approveComment, chooseRouteAndAdvance, delegateWorkItem, deleteModel, deployModel, deployModel, getInboxItems, getWorkflowEngineInfo, getWorkflowInstance, getWorkflowInstanceHistory, getWorkflowInstances, getWorkflowInstances, getWorkflowInstances, getWorkflowInstances, getWorkflowInstanceURLs, getWorkflowModel, getWorkflowModelAsJSON, getWorkflowModels, getWorkItemBackRouteIds, getWorkItemByURI, isWorkflowEngineActive, parseJSONDate, setWorkflowInstanceStatus, startWorkflow, startWorkflow, startWorkflowEngine, stepBackWorkItem, stopWorkflowEngine, updateModel, updateWfInstanceComment, updateWfInstanceMetaData, updateWfInstanceTitle
Methods inherited from class com.adobe.cq.testing.client.CQClient
copyLanguages, copyPage, createPage, createPageWithRetry, createVersion, deletePage, deletePageWithRetry, getAuthorSitesPage, lockPage, movePage, movePage, pageExists, pageExistsWithRetry, pageExistsWithRetry, resetPageStatistics, restoreTree, restoreVersion, rolloutPage, searchAndReplaceInPages, searchInPages, setPageProperties, setPageProperty, setPagePropertyImage, unlockPage, uploadFileCQStyle
Methods inherited from class org.apache.sling.testing.clients.SlingClient
createFolder, createNode, createNodeRecursive, deletePath, doGetJson, endImpersonation, exists, getJsonNode, getJsonNode, getNodeNameFromPath, getParentPath, getUser, getUUId, getUUID, impersonate, importContent, importContent, importJson, move, setPropertiesString, setPropertyString, setPropertyStringArray, upload, waitExists, waitUntilExists
Methods inherited from class org.apache.sling.testing.clients.AbstractSlingClient
adaptTo, addValue, close, doDelete, doGet, doGet, doGet, doHead, doPatch, doPost, doPost, doPut, doRawRequest, doRequest, doStreamGet, doStreamPost, doStreamRequest, execute, execute, execute, execute, execute, execute, execute, execute, getClientId, getConnectionManager, getCookieStore, getCredentialsProvider, getParams, getPassword, getPath, getPath, getUrl, getUrl, getUrl, getValue, getValues, hasValue
-
Field Details
-
LAUNCHER_CONFIG
- See Also:
-
ROOT_PATH_MODEL
- See Also:
-
CQ_MODEL_PAGE_TEMPLATE
- See Also:
-
SAVE_SUFFIX
- See Also:
-
-
Constructor Details
-
CQWorkflowClient
public CQWorkflowClient(org.apache.http.impl.client.CloseableHttpClient http, org.apache.sling.testing.clients.SlingClientConfig config) throws org.apache.sling.testing.clients.ClientException - Throws:
org.apache.sling.testing.clients.ClientException
-
CQWorkflowClient
public CQWorkflowClient(URI serverUrl, String user, String password) throws org.apache.sling.testing.clients.ClientException - Throws:
org.apache.sling.testing.clients.ClientException
-
-
Method Details
-
createNewModelPage
public org.apache.sling.testing.clients.SlingHttpResponse createNewModelPage(String modelName, String modelTitle, int... expectedStatusRange) throws org.apache.sling.testing.clients.ClientException Creates a new Model page in the default directory "/etc/workflow/models/".- Parameters:
modelName
- name of the modelmodelTitle
- title to be given to this modelexpectedStatusRange
- expected HTTP status- Returns:
- the response
- Throws:
org.apache.sling.testing.clients.ClientException
- if the request fails
-
saveModel
public org.apache.sling.testing.clients.SlingHttpResponse saveModel(String modelPath, int... expectedStatus) throws org.apache.sling.testing.clients.ClientException Saves a model.- Parameters:
modelPath
- Name of the model to saveexpectedStatus
- list of expected http status codes- Returns:
- the response
- Throws:
org.apache.sling.testing.clients.ClientException
- if the request fails
-
createWorkflowLauncher
public void createWorkflowLauncher(String workflowId, String path, String nodeType, EventType eventType) throws org.apache.sling.testing.clients.ClientException Adds a new workflow launcher. This method only allows some parameters.- Parameters:
workflowId
- the workflow URIpath
- the path it binds tonodeType
- the node type it affectseventType
- the event type to the node- Throws:
org.apache.sling.testing.clients.ClientException
- if the call to the backend fails
-
editWorkflowLauncher
public void editWorkflowLauncher(String launcherId, String propName, String value) throws org.apache.sling.testing.clients.ClientException Edit one property of an existing workflow launcher identified by the launcher configuration name
The rest of the properties on the workflow launcher stay the same
- Parameters:
launcherId
- the launcher configuration stringpropName
- The name of the property about to be changedvalue
- The value of the property about to be changed- Throws:
org.apache.sling.testing.clients.ClientException
- if the request fails
-
editWorkflowLauncher
public void editWorkflowLauncher(String launcherId, Map<String, String> propMap) throws org.apache.sling.testing.clients.ClientExceptionEdit an existing workflow launcher identified by the launcher configuration name with a set of properties to change
The rest of the properties on the workflow launcher stay the same
- Parameters:
launcherId
- the launcher configuration stringpropMap
- A map with properties names and values to be changed on the workflow- Throws:
org.apache.sling.testing.clients.ClientException
- if the request fails
-
getWorkflowLauncher
public Map<String,String> getWorkflowLauncher(String launcherId) throws org.apache.sling.testing.clients.ClientException Returns aMap
with properties of the workflow launcher- Parameters:
launcherId
- the URI of the launcher- Returns:
- a
Map
with properties - Throws:
org.apache.sling.testing.clients.ClientException
- if the request fails
-
enableDisableWorkflowLauncher
public void enableDisableWorkflowLauncher(String launcherId, boolean enabled) throws org.apache.sling.testing.clients.ClientException Enables or disables the workflow launcher- Parameters:
launcherId
- the id of the launcherenabled
- "true" to enable, "false" to disable- Throws:
org.apache.sling.testing.clients.ClientException
- if the request fails
-
isWorkflowTransient
public boolean isWorkflowTransient(String workflowModel) throws org.apache.sling.testing.clients.ClientException Finds out if the Transient feature flag is enabled for a workflow.- Parameters:
workflowModel
- the path of the workflow model. These are stored at/etc/workflow/models/
. The model path to be provided can be relative (or absolute) to this path- Returns:
True
if the workflow is transient in nature,False
otherwise.- Throws:
org.apache.sling.testing.clients.ClientException
- if it fails to find the specified workflow model.
-