DAG authorization pending - failing test

This commit is contained in:
Dusan Jakub
2023-09-18 18:32:56 +02:00
parent fc039750b2
commit 2be05a2573

View File

@@ -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
public void deviceAuthGrant() throws IOException {
DeviceAuthorizationGrantFlow flow = new DeviceAuthorizationGrantFlow(deviceUri, CLIENT);
@@ -66,4 +58,19 @@ public class DeviceAuthGrantTest {
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();
}
}