@Test
    void verifyFindById() {
        val component = mock(ServicesManager.class);
        val service = mock(RegisteredService.class);
        when(component.findServiceBy(anyLong())).thenReturn(service);
        when(component.findServiceBy(anyLong(), any())).thenCallRealMethod();
        assertNotNull(component.findServiceBy(1, RegisteredService.class));
    }
This is {@link ServicesManagerTests}.

@author Misagh Moayyed
@since 6.3.0
api/cas-server-core-api-services/src/test/java/org/apereo/cas/services/ServicesManagerTests.java