1
0
mirror of synced 2026-08-05 17:57:15 +00:00

Align Test Support Claims

Make all sub claims 'user' and all scopes 'read' to align with
existing support for JWT

Issue gh-7828
Issue gh-7789
Issue gh-7680
Issue gh-7618
This commit is contained in:
Josh Cummings
2020-03-02 17:58:48 -07:00
parent 30adabb685
commit 689fc9df0c
9 changed files with 32 additions and 32 deletions
@@ -79,6 +79,6 @@ public class OAuth2LoginControllerTests {
public void indexGreetsAuthenticatedUser() {
this.rest.mutateWith(mockOAuth2Login())
.get().uri("/").exchange()
.expectBody(String.class).value(containsString("test-subject"));
.expectBody(String.class).value(containsString("user"));
}
}
@@ -263,9 +263,9 @@ public class OAuth2LoginApplicationTests {
public void requestWhenMockOAuth2LoginThenIndex() throws Exception {
ClientRegistration clientRegistration = this.clientRegistrationRepository.findByRegistrationId("github");
this.mvc.perform(get("/").with(oauth2Login().clientRegistration(clientRegistration)))
.andExpect(model().attribute("userName", "test-subject"))
.andExpect(model().attribute("userName", "user"))
.andExpect(model().attribute("clientName", "GitHub"))
.andExpect(model().attribute("userAttributes", Collections.singletonMap("sub", "test-subject")));
.andExpect(model().attribute("userAttributes", Collections.singletonMap("sub", "user")));
}
private void assertLoginPage(HtmlPage page) {
@@ -64,9 +64,9 @@ public class OAuth2LoginControllerTests {
@Test
public void rootWhenAuthenticatedReturnsUserAndClient() throws Exception {
this.mvc.perform(get("/").with(oauth2Login()))
.andExpect(model().attribute("userName", "test-subject"))
.andExpect(model().attribute("userName", "user"))
.andExpect(model().attribute("clientName", "test"))
.andExpect(model().attribute("userAttributes", Collections.singletonMap("sub", "test-subject")));
.andExpect(model().attribute("userAttributes", Collections.singletonMap("sub", "user")));
}
@Test