mirror of
https://github.com/ysoftdevs/oauth-playground-server.git
synced 2026-03-30 14:01:55 +02:00
DAG authorization pending - failing test
This commit is contained in:
@@ -45,14 +45,6 @@ public class DeviceAuthGrantTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void deviceAuthGrant_invalidCode() throws IOException {
|
|
||||||
DeviceCodeScreen deviceCodeScreen = new DeviceCodeScreen(deviceLoginUri);
|
|
||||||
|
|
||||||
HttpStatusException exception = assertThrows(HttpStatusException.class, () -> deviceCodeScreen.enterCode("somecode"));
|
|
||||||
assertThat(exception.getStatusCode(), is(404));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void deviceAuthGrant() throws IOException {
|
public void deviceAuthGrant() throws IOException {
|
||||||
DeviceAuthorizationGrantFlow flow = new DeviceAuthorizationGrantFlow(deviceUri, CLIENT);
|
DeviceAuthorizationGrantFlow flow = new DeviceAuthorizationGrantFlow(deviceUri, CLIENT);
|
||||||
@@ -66,4 +58,19 @@ public class DeviceAuthGrantTest {
|
|||||||
|
|
||||||
flow.exchangeDeviceCode();
|
flow.exchangeDeviceCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void deviceAuthGrant_invalidUserCode() throws IOException {
|
||||||
|
DeviceCodeScreen deviceCodeScreen = new DeviceCodeScreen(deviceLoginUri);
|
||||||
|
|
||||||
|
HttpStatusException exception = assertThrows(HttpStatusException.class, () -> deviceCodeScreen.enterCode("somecode"));
|
||||||
|
assertThat(exception.getStatusCode(), is(404));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void deviceAuthGrant_authorizationPending() throws IOException {
|
||||||
|
DeviceAuthorizationGrantFlow flow = new DeviceAuthorizationGrantFlow(deviceUri, CLIENT);
|
||||||
|
flow.start();
|
||||||
|
flow.exchangeDeviceCode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user