Package com.adobe.cq.testing.client
Class FormClient
- 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.FormClient
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.http.client.HttpClient
- Direct Known Subclasses:
CommerceClient
public class FormClient extends CQClient
The base client for all form-related actions. It provides a core set of commonly used foundation/form functions such as post.
It extends fromCQClient
which in turn provides a core set of commonly used website and page functionality.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.adobe.cq.testing.client.CQClient
CQClient.Builder, CQClient.InternalBuilder<T extends CQClient>
-
-
Field Summary
-
Fields inherited from class com.adobe.cq.testing.client.CQClient
LOG, STATISTICS_ROOT, wcmCommands
-
-
Constructor Summary
Constructors Constructor Description FormClient(URI serverUrl, String user, String password)
FormClient(org.apache.http.impl.client.CloseableHttpClient http, org.apache.sling.testing.clients.SlingClientConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.sling.testing.clients.SlingHttpResponse
doFormPost(String path, String sessionCookie, String formId, String formStart, String redirect, Map<String,String> parameters, String... expectedValidationErrors)
Mimics a submit of a foundation form.-
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
-
-
-
-
Method Detail
-
doFormPost
public org.apache.sling.testing.clients.SlingHttpResponse doFormPost(String path, String sessionCookie, String formId, String formStart, String redirect, Map<String,String> parameters, String... expectedValidationErrors) throws org.apache.sling.testing.clients.ClientException
Mimics a submit of a foundation form.- Parameters:
path
- path to thecq:Page
containing the formsessionCookie
- an optional session cookie to add to the requestformId
- the id of the form on the pageformStart
- the path to the form-start component on the pageredirect
- the redirect to follow after a successful submissionparameters
- the form parameters to postexpectedValidationErrors
- an optional list of expected validation messages- Returns:
- a
SlingHttpResponse
with a 302 redirect assuming a successful submission - Throws:
org.apache.sling.testing.clients.ClientException
- if the request fails
-
-