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:
+1
-1
@@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user