From 0d7ba7012eb3636682c733de3b7e17a586d7e2ba Mon Sep 17 00:00:00 2001 From: Joe Grandja Date: Sat, 16 Mar 2024 07:08:21 -0400 Subject: [PATCH] Revert "Temporarily disable integration tests in demo-authorizationserver sample" This reverts commit d25331ce5027a433d4e5a94bf2ef7b05fc0c2d9d. --- .../sample/DemoAuthorizationServerApplicationTests.java | 8 ++++---- .../java/sample/DemoAuthorizationServerConsentTests.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/demo-authorizationserver/src/test/java/sample/DemoAuthorizationServerApplicationTests.java b/samples/demo-authorizationserver/src/test/java/sample/DemoAuthorizationServerApplicationTests.java index ee9b5f39..36d121f0 100644 --- a/samples/demo-authorizationserver/src/test/java/sample/DemoAuthorizationServerApplicationTests.java +++ b/samples/demo-authorizationserver/src/test/java/sample/DemoAuthorizationServerApplicationTests.java @@ -67,7 +67,7 @@ public class DemoAuthorizationServerApplicationTests { this.webClient.getCookieManager().clearCookies(); // log out } -// @Test + @Test public void whenLoginSuccessfulThenDisplayBadRequestError() throws IOException { HtmlPage page = this.webClient.getPage("/"); @@ -79,7 +79,7 @@ public class DemoAuthorizationServerApplicationTests { assertThat(signInResponse.getStatusCode()).isEqualTo(HttpStatus.BAD_REQUEST.value()); // there is no "default" index page } -// @Test + @Test public void whenLoginFailsThenDisplayBadCredentials() throws IOException { HtmlPage page = this.webClient.getPage("/"); @@ -90,14 +90,14 @@ public class DemoAuthorizationServerApplicationTests { assertThat(alert.asNormalizedText()).isEqualTo("Invalid username or password."); } -// @Test + @Test public void whenNotLoggedInAndRequestingTokenThenRedirectsToLogin() throws IOException { HtmlPage page = this.webClient.getPage(AUTHORIZATION_REQUEST); assertLoginPage(page); } -// @Test + @Test public void whenLoggingInAndRequestingTokenThenRedirectsToClientApplication() throws IOException { // Log in this.webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); diff --git a/samples/demo-authorizationserver/src/test/java/sample/DemoAuthorizationServerConsentTests.java b/samples/demo-authorizationserver/src/test/java/sample/DemoAuthorizationServerConsentTests.java index c231c34c..d3a6a3f9 100644 --- a/samples/demo-authorizationserver/src/test/java/sample/DemoAuthorizationServerConsentTests.java +++ b/samples/demo-authorizationserver/src/test/java/sample/DemoAuthorizationServerConsentTests.java @@ -77,7 +77,7 @@ public class DemoAuthorizationServerConsentTests { when(this.authorizationConsentService.findById(any(), any())).thenReturn(null); } -// @Test + @Test @WithMockUser("user1") public void whenUserConsentsToAllScopesThenReturnAuthorizationCode() throws IOException { final HtmlPage consentPage = this.webClient.getPage(this.authorizationRequestUri); @@ -107,7 +107,7 @@ public class DemoAuthorizationServerConsentTests { assertThat(location).contains("code="); } -// @Test + @Test @WithMockUser("user1") public void whenUserCancelsConsentThenReturnAccessDeniedError() throws IOException { final HtmlPage consentPage = this.webClient.getPage(this.authorizationRequestUri);