@Test
    void verifySaveAndGet() {
        val registeredService = new CasRegisteredService();
        registeredService.setId(RandomUtils.nextLong());
        registeredService.setName(UUID.randomUUID().toString());
        registeredService.setServiceId(registeredService.getName());
        servicesManager.save(registeredService);
        assertNotNull(servicesManager.findServiceBy(registeredService.getId()));
        assertNotNull(servicesManager.findServiceBy(registeredService.getId(), CasRegisteredService.class));
        assertNotNull(servicesManager.findServiceByName(registeredService.getName()));
        assertNotNull(servicesManager.findServiceByName(registeredService.getName(), CasRegisteredService.class));
        assertTrue(servicesManager.count() > 0);
        assertFalse(servicesManager.getAllServicesOfType(CasRegisteredService.class).isEmpty());

        val mockSvc = mock(RegisteredService.class);
        assertTrue(servicesManager.getAllServicesOfType(mockSvc.getClass()).isEmpty());
    }
This is {@link AbstractServicesManagerTests}.

@author Misagh Moayyed
@since 5.2.0
core/cas-server-core-services/src/test/java/org/apereo/cas/services/AbstractServicesManagerTests.java