refactor tests - bad creds

This commit is contained in:
Dusan Jakub
2023-09-19 22:22:39 +02:00
parent 24159f7dcb
commit 95cf6152b6
2 changed files with 16 additions and 3 deletions

View File

@@ -59,6 +59,17 @@ public class AuthCodeGrantTest {
assertThat(accessTokenResponse.accessToken(), is(notNullValue()));
}
@Test
public void badCredentials() throws IOException {
AuthorizationCodeFlow flow = new AuthorizationCodeFlow(authUrl, CLIENT)
.scope("scope1 scope2");
LoginScreen loginScreen = flow.start().expectLogin();
loginScreen.submit("x", "bbb").expectError("Invalid credentials")
.submit("bob", "bbb").expectError("Invalid credentials")
.submit("bob", "password").expectSuccess();
}
@Test
public void authCodeGrant_invalidResponseType() throws IOException {
AuthorizationCodeFlow flow = new AuthorizationCodeFlow(authUrl, CLIENT)