Package com.adobe.cq.testing.util
Class LoginUtil
java.lang.Object
com.adobe.cq.testing.util.LoginUtil
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends org.apache.sling.testing.clients.AbstractSlingClient>
org.apache.http.client.methods.HttpPostbuildFormAuthPost
(T graniteClient, String user, String pass, String page) Creates the post request with the form for authenticationstatic org.apache.http.HttpResponse
doGetWithLoginToken
(String loginToken, CQClient cqClient, String testPage) Retrieves a page using the given login tokenstatic <T extends org.apache.sling.testing.clients.AbstractSlingClient>
StringgetLoginToken
(T graniteClient, String targetPage) Retrieves a login token
-
Field Details
-
FORM_AUTH_URL
- See Also:
-
-
Constructor Details
-
LoginUtil
public LoginUtil()
-
-
Method Details
-
doGetWithLoginToken
public static org.apache.http.HttpResponse doGetWithLoginToken(String loginToken, CQClient cqClient, String testPage) throws IOException Retrieves a page using the given login token- Parameters:
loginToken
- login tokencqClient
- client to usetestPage
- path to the page- Returns:
- the http response
- Throws:
IOException
- if the request fails
-
getLoginToken
public static <T extends org.apache.sling.testing.clients.AbstractSlingClient> String getLoginToken(T graniteClient, String targetPage) throws IOException Retrieves a login token- Type Parameters:
T
- client type- Parameters:
graniteClient
- client to usetargetPage
- path to the page- Returns:
- the login token
- Throws:
IOException
- if the request fails
-
buildFormAuthPost
public static <T extends org.apache.sling.testing.clients.AbstractSlingClient> org.apache.http.client.methods.HttpPost buildFormAuthPost(T graniteClient, String user, String pass, String page) Creates the post request with the form for authentication- Type Parameters:
T
- client type- Parameters:
graniteClient
- client to useuser
- usernamepass
- passwordpage
- path to the page- Returns:
- the http post
-