@Test
    void verifyAccessTokenResponseForDeviceCode() throws Throwable {
        val devCode = deviceTokenFactory.createDeviceCode(RegisteredServiceTestUtils.getService());

        val token = OAuth20TokenGeneratedResult.builder()
            .registeredService(getOidcRegisteredService())
            .responseType(OAuth20ResponseTypes.DEVICE_CODE)
            .deviceCode(devCode.getId())
            .userCode(deviceUserCodeFactory.createDeviceUserCode(devCode.getService()).getId())
            .build();

        val request = new MockHttpServletRequest();
        val response = new MockHttpServletResponse();
        val context = new JEEContext(request, response);
        val manager = new ProfileManager(context, new JEESessionStore());

        val profile = new CommonProfile();
        profile.setClientName(Authenticators.CAS_OAUTH_CLIENT_BASIC_AUTHN);
        profile.setId("casuser");

        manager.save(true, profile, false);

        val result = OAuth20AccessTokenResponseResult.builder()
            .service(RegisteredServiceTestUtils.getService())
            .registeredService(getOidcRegisteredService())
            .casProperties(casProperties)
            .generatedToken(token)
            .responseType(OAuth20ResponseTypes.DEVICE_CODE)
            .userProfile(profile)
            .build();

        val mv = oidcAccessTokenResponseGenerator.generate(result);
        assertNotNull(mv);
        val modelMap = mv.getModelMap();

        assertTrue(modelMap.containsKey(OAuth20Constants.DEVICE_VERIFICATION_URI));
        assertTrue(modelMap.containsKey(OAuth20Constants.DEVICE_USER_CODE));
        assertTrue(modelMap.containsKey(OAuth20Constants.DEVICE_CODE));
        assertTrue(modelMap.containsKey(OAuth20Constants.DEVICE_INTERVAL));
    }
This is {@link OidcAccessTokenResponseGeneratorTests}.

@author Misagh Moayyed
@since 6.1.0
support/cas-server-support-oidc/src/test/java/org/apereo/cas/oidc/web/OidcAccessTokenResponseGeneratorTests.java