Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

Adds a simple basic auth test for the /me endpoint #337

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/main/groovy/com/stormpath/tck/me/MeIT.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class MeIT extends AbstractIT {
* TODO - disabling test to remove Stormpath specific behavior
*/
@Test(groups=["v100", "json"], enabled=false)
void meWithBasicAuthReturnsJsonUser() throws Exception {
void meWithApiKeyBasicAuthReturnsJsonUser() throws Exception {
Response apiKeysResource = given()
.header("User-Agent", "stormpath-framework-tck")
.header("Authorization", RestUtils.getBasicAuthorizationHeaderValue())
Expand All @@ -189,6 +189,20 @@ class MeIT extends AbstractIT {
.spec(AccountResponseSpec.matchesAccount(account))
}

/**
* Test that Basic with user/password works against /me
*/
@Test(groups=["v100", "json"])
void meWithBasicAuthReturnsJsonUser() throws Exception {

given()
.auth().preemptive().basic(account.username, account.password)
.when()
.get(MeRoute)
.then()
.spec(AccountResponseSpec.matchesAccount(account))
}

/**
* We should not have linked resources.
* @see https://github.com/stormpath/stormpath-framework-tck/issues/64
Expand Down