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
-
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, wcmCommandsFields inherited from class org.apache.sling.testing.clients.SlingClient
CLIENT_CONNECTION_TIMEOUT_PROP, DEFAULT_NODE_TYPE, SUDO_COOKIE_NAME -
Constructor Summary
ConstructorsConstructorDescriptionFormClient(URI serverUrl, String user, String password) FormClient(org.apache.http.impl.client.CloseableHttpClient http, org.apache.sling.testing.clients.SlingClientConfig config) -
Method Summary
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, uploadFileCQStyleMethods 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, waitUntilExistsMethods 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
-
Constructor Details
-
FormClient
public FormClient(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
-
FormClient
-
-
Method Details
-
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.ClientExceptionMimics a submit of a foundation form.- Parameters:
path- path to thecq:Pagecontaining 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
SlingHttpResponsewith a 302 redirect assuming a successful submission - Throws:
org.apache.sling.testing.clients.ClientException- if the request fails
-