@Test
    void verifyNoService() {
        val service = RegisteredServiceTestUtils.getService("nosigningservice");
        val registeredService = servicesManager.findServiceBy(service);
        assertThrows(UnauthorizedServiceException.class,
            () -> TokenAuthenticationSecurity.forRegisteredService(registeredService).toGenerator());
        val credential = new TokenCredential(UUID.randomUUID().toString(), service);
        assertThrows(AuthenticationException.class, () -> tokenAuthenticationHandler.authenticate(credential, credential.getService()));
    }
This is {@link TokenAuthenticationHandlerTests}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-token-authentication/src/test/java/org/apereo/cas/token/authentication/TokenAuthenticationHandlerTests.java