From 2be05a2573209e4a6819693f6a4465cd806969a9 Mon Sep 17 00:00:00 2001 From: Dusan Jakub Date: Mon, 18 Sep 2023 18:32:56 +0200 Subject: [PATCH] DAG authorization pending - failing test --- .../com/ysoft/geecon/DeviceAuthGrantTest.java | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/test/java/com/ysoft/geecon/DeviceAuthGrantTest.java b/src/test/java/com/ysoft/geecon/DeviceAuthGrantTest.java index 80ff55a..88cb1fe 100644 --- a/src/test/java/com/ysoft/geecon/DeviceAuthGrantTest.java +++ b/src/test/java/com/ysoft/geecon/DeviceAuthGrantTest.java @@ -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(); + } } \ No newline at end of file