@Bean
        public DuoSecurityClient duoUniversalPromptAuthenticationClient() throws Exception {
            val client = mock(DuoSecurityClient.class);
            
            val token = new Token();
            token.setSub("casuser");

            val user = new User();
            user.setKey(UUID.randomUUID().toString());
            user.setName("casuser");

            val authCtx = new AuthContext();

            val application = new Application();
            application.setKey(UUID.randomUUID().toString());
            application.setName("CAS");
            authCtx.setApplication(application);
            authCtx.setUser(user);
            authCtx.setEvent_type("auth");

            val accessDevice = new AccessDevice();
            accessDevice.setIp("1.2.3.4");

            val location = new Location();
            location.setCity("London");
            location.setCountry("UK");
            accessDevice.setLocation(location);
            authCtx.setAccess_device(accessDevice);

            val authDevice = new AuthDevice();
            authDevice.setLocation(location);
            authDevice.setIp("1.2.3.4");
            authCtx.setAuth_device(authDevice);

            token.setAuth_context(authCtx);

            val authResult = new AuthResult();
            authResult.setResult("OK");
            token.setAuth_result(authResult);

            val duoClient = mock(Client.class);
            when(duoClient.generateState()).thenReturn(UUID.randomUUID().toString());
            when(duoClient.createAuthUrl(anyString(), anyString())).thenReturn("https://duo.com");
            when(duoClient.exchangeAuthorizationCodeFor2FAResult(anyString(), anyString())).thenReturn(token);

            when(client.getInstance()).thenReturn(duoClient);
            return client;
        }
This is {@link DuoSecurityUniversalPromptValidateLoginActionTests}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-duo/src/test/java/org/apereo/cas/adaptors/duo/web/flow/action/DuoSecurityUniversalPromptValidateLoginActionTests.java