@Test
    void verifyApproval() throws Throwable {
        val request = new MockHttpServletRequest();
        val response = new MockHttpServletResponse();
        val devCode = defaultDeviceTokenFactory.createDeviceCode(RegisteredServiceTestUtils.getService());
        val uc = defaultDeviceUserCodeFactory.createDeviceUserCode(devCode.getService());
        ticketRegistry.addTicket(uc);
        request.setParameter(OAuth20DeviceUserCodeApprovalEndpointController.PARAMETER_USER_CODE, uc.getId());
        var mv = callbackAuthorizeController.handlePostRequest(request, response);
        assertFalse(mv.getModel().containsKey("error"));
        assertTrue(uc.isUserCodeApproved());
        assertEquals(OAuth20Constants.DEVICE_CODE_APPROVED_VIEW, mv.getViewName());

        mv = callbackAuthorizeController.handlePostRequest(request, response);
        assertTrue(mv.getModel().containsKey("prefix"));
        assertTrue(mv.getModel().containsKey("error"));
    }
This is {@link OAuth20DeviceUserCodeApprovalEndpointControllerTests}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-oauth/src/test/java/org/apereo/cas/support/oauth/web/endpoints/OAuth20DeviceUserCodeApprovalEndpointControllerTests.java