Package com.adobe.cq.testing.util
Class LoginUtil
- java.lang.Object
-
- com.adobe.cq.testing.util.LoginUtil
-
public class LoginUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
FORM_AUTH_URL
-
Constructor Summary
Constructors Constructor Description LoginUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <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 Detail
-
FORM_AUTH_URL
public static final String FORM_AUTH_URL
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
-
-