@Test
        void verifyPass() throws Throwable {
            val context = MockRequestContext.create(applicationContext);
            val webContext = new JEEContext(context.getHttpServletRequest(), context.getHttpServletResponse());

            val authentication = RegisteredServiceTestUtils.getAuthentication();
            WebUtils.putAuthentication(authentication, context);
            WebUtils.putRegisteredService(context, RegisteredServiceTestUtils.getRegisteredService());

            val provider = MultifactorAuthenticationUtils.getMultifactorAuthenticationProviderById(
                DuoSecurityMultifactorAuthenticationProperties.DEFAULT_IDENTIFIER, applicationContext).orElseThrow();
            MultifactorAuthenticationWebflowUtils.putMultifactorAuthenticationProvider(context, provider);
            WebUtils.putTargetTransition(context, "targetDestination");

            val authnResult = new DefaultAuthenticationResultBuilder(principalElectionStrategy)
                .collect(RegisteredServiceTestUtils.getAuthentication());

            WebUtils.putAuthenticationResultBuilder(authnResult, context);
            context.getFlashScope().put("name", "value");
            context.getConversationScope().put("name", "value");
            context.getRequestScope().put("name", "value");

            val prepResult = duoUniversalPromptPrepareLoginAction.execute(context);

            val storage = (BrowserStorage) prepResult.getAttributes().get("result");
            val payload = MAPPER.writeValueAsString(Map.of(storage.getContext(), storage.getPayload()));
            val attributes = duoUniversalPromptSessionStore.buildFromTrackableSession(webContext, payload)
                .map(BrowserWebStorageSessionStore.class::cast)
                .orElseThrow()
                .getSessionAttributes(webContext);

            val code = UUID.randomUUID().toString();
            context.setParameter(DuoSecurityUniversalPromptValidateLoginAction.REQUEST_PARAMETER_CODE, code);
            context.setParameter(DuoSecurityUniversalPromptValidateLoginAction.REQUEST_PARAMETER_STATE,
                attributes.get(DuoSecurityAuthenticationService.class.getSimpleName()).toString());
            context.setParameter(BrowserStorage.PARAMETER_BROWSER_STORAGE, payload);

            val result = duoUniversalPromptValidateLoginAction.execute(context);
            assertNotNull(result);
            assertEquals("targetDestination", result.getId());
            assertNotNull(WebUtils.getAuthentication(context));
            assertNotNull(WebUtils.getRegisteredService(context));
            assertNotNull(WebUtils.getAuthenticationResult(context));
        }
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