@Test
    void verifyAuthz() {
        val registry = mock(BaseYubiKeyAccountRegistry.class);
        when(registry.isYubiKeyRegisteredFor(anyString(), anyString())).thenCallRealMethod();
        when(registry.isYubiKeyRegisteredFor(anyString())).thenCallRealMethod();
        when(registry.getAccount(anyString())).thenThrow(new RuntimeException());

        assertFalse(registry.isYubiKeyRegisteredFor("cas"));
        assertFalse(registry.isYubiKeyRegisteredFor("cas", "device"));
    }
This is {@link YubiKeyAccountRegistryTests}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-yubikey-core/src/test/java/org/apereo/cas/adaptors/yubikey/registry/YubiKeyAccountRegistryTests.java