@Test
    void verifyExistingAccount() throws Throwable {
        val account = OneTimeTokenAccount.builder()
            .username("casuser")
            .secretKey(UUID.randomUUID().toString())
            .validationCode(123456)
            .scratchCodes(List.of())
            .name(UUID.randomUUID().toString())
            .build();
        val repository = mock(OneTimeTokenCredentialRepository.class);
        when(repository.get(anyString())).thenReturn((Collection) List.of(account));
        val action = new OneTimeTokenAccountCheckRegistrationAction(repository, casProperties, tenantExtractor);

        val context = MockRequestContext.create(applicationContext);
        ApplicationContextProvider.registerBeanIntoApplicationContext(context.getApplicationContext(),
            MultifactorAuthenticationPrincipalResolver.identical(), UUID.randomUUID().toString());
        val provider = TestMultifactorAuthenticationProvider.registerProviderIntoApplicationContext(context.getApplicationContext());
        MultifactorAuthenticationWebflowUtils.putMultifactorAuthenticationProvider(context, provider);
        WebUtils.putAuthentication(RegisteredServiceTestUtils.getAuthentication("casuser"), context);
        assertEquals(CasWebflowConstants.TRANSITION_ID_SUCCESS, action.execute(context).getId());
    }
This is {@link OneTimeTokenAccountCheckRegistrationActionTests}.

@author Misagh Moayyed
@since 6.2.0
support/cas-server-support-otp-mfa/src/test/java/org/apereo/cas/otp/web/flow/OneTimeTokenAccountCheckRegistrationActionTests.java