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