From eea017fd3dc89af81b74757afc26d87063773e32 Mon Sep 17 00:00:00 2001 From: Brian Demers Date: Thu, 15 Jun 2017 13:04:13 -0400 Subject: [PATCH] Adds a simple basic auth test for the /me endpoint --- src/main/groovy/com/stormpath/tck/me/MeIT.groovy | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/groovy/com/stormpath/tck/me/MeIT.groovy b/src/main/groovy/com/stormpath/tck/me/MeIT.groovy index 81457be..3dfa324 100644 --- a/src/main/groovy/com/stormpath/tck/me/MeIT.groovy +++ b/src/main/groovy/com/stormpath/tck/me/MeIT.groovy @@ -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()) @@ -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