@Test
    void verifyStoreToken() {
        val props = casProperties.getAuthn().getMfa().getSimple().getToken().getRest();
        val port = URI.create(props.getUrl()).getPort();

        val tokenId = UUID.randomUUID().toString();
        val service = RegisteredServiceTestUtils.getService();
        try (val webServer = new MockWebServer(port,
            new ByteArrayResource(tokenId.getBytes(StandardCharsets.UTF_8), "Output"), HttpStatus.CREATED)) {
            webServer.start();
            val mfaFactory = (CasSimpleMultifactorAuthenticationTicketFactory)
                defaultTicketFactory.get(CasSimpleMultifactorAuthenticationTicket.class);
            var token = mfaFactory.create(tokenId, service, Map.of());
            assertDoesNotThrow(() -> multifactorAuthenticationService.store(token));
        }
        try (val webServer = new MockWebServer(port,
            new ByteArrayResource(tokenId.getBytes(StandardCharsets.UTF_8), "Output"), HttpStatus.INTERNAL_SERVER_ERROR)) {
            webServer.start();
            val mfaFactory = (CasSimpleMultifactorAuthenticationTicketFactory)
                defaultTicketFactory.get(CasSimpleMultifactorAuthenticationTicket.class);
            var token = mfaFactory.create(tokenId, service, Map.of());
            assertThrows(FailedLoginException.class, () -> multifactorAuthenticationService.store(token));
        }
    }
This is {@link RestfulCasSimpleMultifactorAuthenticationServiceTests}.

@author Misagh Moayyed
@since 6.6.0
support/cas-server-support-simple-mfa/src/test/java/org/apereo/cas/mfa/simple/validation/RestfulCasSimpleMultifactorAuthenticationServiceTests.java