@Test
    void verifyOperation() throws Throwable {
        assertNotNull(qrAuthenticationTokenAuthenticationHandler);

        val tgt = new MockTicketGrantingTicket("casuser");
        ticketRegistry.addTicket(tgt);

        val deviceId = UUID.randomUUID().toString();
        qrAuthenticationDeviceRepository.authorizeDeviceFor(deviceId, tgt.getAuthentication().getPrincipal().getId());

        val payload = JwtBuilder.JwtRequest.builder()
            .subject(tgt.getAuthentication().getPrincipal().getId())
            .jwtId(tgt.getId())
            .issuer(casProperties.getServer().getPrefix())
            .serviceAudience(Set.of("https://example.com/normal/"))
            .validUntilDate(DateTimeUtils.dateOf(LocalDate.now(Clock.systemUTC()).plusDays(1)))
            .attributes(Map.of(QRAuthenticationConstants.QR_AUTHENTICATION_DEVICE_ID, List.of(deviceId)))
            .build();
        val jwt = jwtBuilder.build(payload);
        val credential = new QRAuthenticationTokenCredential(jwt, UUID.randomUUID().toString());
        credential.setDeviceId(deviceId);
        val result = qrAuthenticationTokenAuthenticationHandler.authenticate(credential, mock(Service.class));
        assertEquals(tgt.getAuthentication().getPrincipal().getId(), result.getPrincipal().getId());
    }
This is {@link QRAuthenticationTokenAuthenticationHandlerTests}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-qr-authentication/src/test/java/org/apereo/cas/qr/authentication/QRAuthenticationTokenAuthenticationHandlerTests.java