@Test
    void verifyOperationFails() throws Throwable {
        val context = MockRequestContext.create(applicationContext);
        val credential = RegisteredServiceTestUtils.getCredentialsWithDifferentUsernameAndPassword("casuser", "123456");
        WebUtils.putCredential(context, credential);
        val event = yubikeyAuthenticationWebflowEventResolver.resolveSingle(context);
        assertEquals(CasWebflowConstants.TRANSITION_ID_ERROR, event.getId());
        assertEquals(HttpStatus.UNAUTHORIZED.value(), context.getHttpServletResponse().getStatus());
        val support = new EventFactorySupport();
        assertTrue(event.getAttributes().contains(support.getExceptionAttributeName()));
    }
This is {@link YubiKeyAuthenticationWebflowEventResolverTests}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-yubikey/src/test/java/org/apereo/cas/adaptors/yubikey/web/flow/YubiKeyAuthenticationWebflowEventResolverTests.java