@Test
    void verifyOperation() throws Throwable {
        val props = casProperties.getAuthn().getMfa().getDuo().getFirst();
        val port = URI.create(props.getDuoApiHost()).getPort();
        try (val webServer = new MockWebServer(true, port, new ClassPathResource("duo-adminapi-user.json"))) {
            webServer.start();

            val request = PasswordlessAuthenticationRequest.builder().username("casuser").build();
            val user = passwordlessUserAccountStore.findUser(request).orElseThrow();
            assertEquals("jsmith", user.getUsername());
            assertEquals("jsmith@example.com", user.getEmail());
            assertEquals(props.getId(), user.getSource());
            assertNotNull(duoSecurityVerifyPasswordlessAuthenticationAction);

            val data = Map.of("stat", "OK", "response", Map.of("result", "allow", "status", "allow"));
            webServer.responseBodyJson(data);
            val context = MockRequestContext.create(applicationContext);
            PasswordlessWebflowUtils.putPasswordlessAuthenticationAccount(context, user);
            val result = duoSecurityVerifyPasswordlessAuthenticationAction.execute(context);
            assertEquals(CasWebflowConstants.TRANSITION_ID_SUCCESS, result.getId());
            assertNotNull(WebUtils.getAuthentication(context));
            assertNotNull(WebUtils.getCredential(context));
        }
    }
This is {@link DuoSecurityPasswordlessUserAccountStoreTests}.

@author Misagh Moayyed
@since 7.1.0
support/cas-server-support-duo/src/test/java/org/apereo/cas/adaptors/duo/authn/passwordless/DuoSecurityPasswordlessUserAccountStoreTests.java