Skip to content

Commit 25c9c2b

Browse files
ddubsonjgrandja
authored andcommitted
Fix samples test suite execution and failing tests
Closes gh-1324
1 parent 215c101 commit 25c9c2b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

samples/demo-authorizationserver/samples-demo-authorizationserver.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ dependencies {
3030
testImplementation "org.junit.jupiter:junit-jupiter"
3131
testImplementation "net.sourceforge.htmlunit:htmlunit"
3232
}
33+
34+
test {
35+
useJUnitPlatform()
36+
}

samples/demo-authorizationserver/src/test/java/sample/DemoAuthorizationServerApplicationTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ public void whenLoginSuccessfulThenDisplayNotFoundError() throws IOException {
7575

7676
this.webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);
7777
WebResponse signInResponse = signIn(page, "user1", "password").getWebResponse();
78-
assertThat(signInResponse.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND.value()); // there is no "default" index page
78+
79+
assertThat(signInResponse.getStatusCode()).isEqualTo(HttpStatus.BAD_REQUEST.value()); // there is no "default" index page
7980
}
8081

8182
@Test
@@ -86,7 +87,7 @@ public void whenLoginFailsThenDisplayBadCredentials() throws IOException {
8687

8788
HtmlElement alert = loginErrorPage.querySelector("div[role=\"alert\"]");
8889
assertThat(alert).isNotNull();
89-
assertThat(alert.getTextContent()).isEqualTo("Bad credentials");
90+
assertThat(alert.asNormalizedText()).isEqualTo("Invalid username or password.");
9091
}
9192

9293
@Test

0 commit comments

Comments
 (0)