@Test
    void verifyInvalidAcct() {
        val registeredDevice = YubiKeyRegisteredDevice.builder()
            .id(System.currentTimeMillis())
            .name("first-device")
            .publicId("bad-id")
            .registrationDate(ZonedDateTime.now(Clock.systemUTC()))
            .build();

        val account = YubiKeyAccount.builder()
            .devices(CollectionUtils.wrapList(registeredDevice))
            .username("casuser")
            .build();

        val registry = mock(BaseYubiKeyAccountRegistry.class);
        when(registry.getAccount(anyString())).thenCallRealMethod();
        when(registry.getCipherExecutor()).thenThrow(new RuntimeException());
        when(registry.getAccountInternal(anyString())).thenReturn(account);

        val result = registry.getAccount("cas");
        assertTrue(result.isPresent());
        assertTrue(result.get().getDevices().isEmpty());
    }
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