public class FormClient extends CQClient
CQClient
which in turn provides a core set of commonly used website and page
functionality.CQClient.Builder, CQClient.InternalBuilder<T extends CQClient>
LOG, STATISTICS_ROOT, wcmCommands
Constructor and Description |
---|
FormClient(org.apache.http.impl.client.CloseableHttpClient http,
org.apache.sling.testing.clients.SlingClientConfig config) |
FormClient(URI serverUrl,
String user,
String password) |
Modifier and Type | Method and 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.
|
copyLanguages, copyPage, createPage, createPageWithRetry, createVersion, deletePage, deletePageWithRetry, lockPage, movePage, movePage, resetPageStatistics, restoreTree, restoreVersion, rolloutPage, searchAndReplaceInPages, searchInPages, setPageProperties, setPageProperty, setPagePropertyImage, unlockPage, uploadAsset, uploadFileCQStyle
createFolder, createNode, createNodeRecursive, deletePath, doGetJson, exists, getJsonNode, getJsonNode, getNodeNameFromPath, getParentPath, getUUId, getUUID, importContent, importContent, importJson, move, setPropertiesString, setPropertyString, setPropertyStringArray, upload, waitExists, waitUntilExists
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, getUser, getValue, getValues, hasValue
public FormClient(org.apache.http.impl.client.CloseableHttpClient http, org.apache.sling.testing.clients.SlingClientConfig config) throws org.apache.sling.testing.clients.ClientException
org.apache.sling.testing.clients.ClientException
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
path
- path to the cq: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 messagesSlingHttpResponse
with a 302 redirect assuming a successful submissionorg.apache.sling.testing.clients.ClientException
- if the request failsCopyright © 2018. All rights reserved.