Package com.atlassian.crowd.test.util
Class RestUtils
java.lang.Object
com.atlassian.crowd.test.util.RestUtils
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addDirectoryMapping
(String baseUrl, long appId, long dirId) static void
addDirectoryMapping
(String baseUrl, long appId, long directoryId, boolean allowAll, Set<String> allowedGroups) static io.restassured.specification.RequestSpecification
static io.restassured.specification.RequestSpecification
adminRequest
(io.restassured.http.ContentType contentType, io.restassured.http.ContentType accept) static io.restassured.specification.RequestSpecification
static io.restassured.specification.RequestSpecification
anonymousRequest
(io.restassured.http.ContentType contentType, io.restassured.http.ContentType accept) static io.restassured.specification.RequestSpecification
static io.restassured.specification.RequestSpecification
appRequest
(String appName, String password) static void
assertScheduledJobProperty
(String baseUrl, String id, String field, org.hamcrest.Matcher<?> matcher) static void
assignGroupLevelAdmin
(DirectoryEntityId groupLevelAdminId, DirectoryEntityId groupTargetId) static ApplicationEntity
getApplication
(String baseUrl, String applicationName) static DirectoryMappingEntity
getApplicationDirectoryMapping
(String baseUrl, long appId, long directoryId) static List<DirectoryMappingEntity>
getApplicationDirectoryMappings
(String baseUrl, long appId) static Collection<String>
getClusterNodeIds
(String baseUrl) static <T> T
getPluginSetting
(String baseUrl, String key) static boolean
isClustered
(String baseUrl) static LoginResult
loginAsAdmin
(String baseUrl) static LoginResult
loginAsUser
(String baseUrl, String username, String password) static LoginResult
loginAsUser
(String baseUrl, String username, String password, boolean addCsrfHeader) static io.restassured.specification.RequestSpecification
static URI
relativeLocation
(io.restassured.response.Response response, String baseUrl) static io.restassured.specification.RequestSpecification
static void
setDirectoryMappingIndex
(String baseUrl, long appId, long dirId, int index) static void
setDirectoryMappingIndex
(String baseUrl, String appName, String dirName, int index) static void
setPluginSetting
(String baseUrl, String key, Object value) static io.restassured.specification.RequestSpecification
userRequest
(String username, String password) static io.restassured.specification.RequestSpecification
userRequest
(String username, String password, io.restassured.http.ContentType contentType, io.restassured.http.ContentType accept) static io.restassured.specification.RequestSpecification
withCookie
(String cookieName, String cookieValue)
-
Field Details
-
REMEMBER_ME_COOKIE
- See Also:
-
SSO_COOKIE
- See Also:
-
ADMIN_USER
- See Also:
-
ADMIN_PW
- See Also:
-
SECOND_ADMIN_USER
- See Also:
-
SECOND_ADMIN_PW
- See Also:
-
APP_NAME
- See Also:
-
APP_PW
- See Also:
-
REGULAR_USER_USERNAME
- See Also:
-
REGULAR_USER_PASSWORD
- See Also:
-
-
Method Details
-
adminRequest
public static io.restassured.specification.RequestSpecification adminRequest() -
adminRequest
public static io.restassured.specification.RequestSpecification adminRequest(io.restassured.http.ContentType contentType, io.restassured.http.ContentType accept) -
secondAdminRequest
public static io.restassured.specification.RequestSpecification secondAdminRequest() -
anonymousRequest
public static io.restassured.specification.RequestSpecification anonymousRequest() -
anonymousRequest
public static io.restassured.specification.RequestSpecification anonymousRequest(io.restassured.http.ContentType contentType, io.restassured.http.ContentType accept) -
appRequest
public static io.restassured.specification.RequestSpecification appRequest() -
appRequest
-
regularUserRequest
public static io.restassured.specification.RequestSpecification regularUserRequest() -
userRequest
-
userRequest
-
assertScheduledJobProperty
-
setPluginSetting
-
getPluginSetting
-
isClustered
-
getClusterNodeIds
-
setDirectoryMappingIndex
-
withCookie
-
getApplication
-
getApplicationDirectoryMappings
public static List<DirectoryMappingEntity> getApplicationDirectoryMappings(String baseUrl, long appId) -
getApplicationDirectoryMapping
public static DirectoryMappingEntity getApplicationDirectoryMapping(String baseUrl, long appId, long directoryId) -
setDirectoryMappingIndex
-
addDirectoryMapping
-
addDirectoryMapping
-
loginAsAdmin
-
loginAsUser
-
loginAsUser
public static LoginResult loginAsUser(String baseUrl, String username, String password, boolean addCsrfHeader) -
assignGroupLevelAdmin
public static void assignGroupLevelAdmin(DirectoryEntityId groupLevelAdminId, DirectoryEntityId groupTargetId) -
relativeLocation
public static URI relativeLocation(io.restassured.response.Response response, String baseUrl) throws MalformedURLException, URISyntaxException
-