public static RegisteredService getRegisteredService(final String id) {
        val service = mock(RegisteredService.class);
        when(service.getServiceId()).thenReturn(id);
        when(service.getName()).thenReturn("service");
        when(service.getId()).thenReturn(RandomUtils.nextLong());
        when(service.getDescription()).thenReturn("description");

        val access = mock(RegisteredServiceAccessStrategy.class);
        when(access.isServiceAccessAllowed(service, CoreAuthenticationTestUtils.getService())).thenReturn(true);
        when(service.getAccessStrategy()).thenReturn(access);
        return service;
    }
This is {@link CoreAttributesTestUtils}.

@author Misagh Moayyed
@since 5.2.0
core/cas-server-core-authentication-attributes/src/test/java/org/apereo/cas/CoreAttributesTestUtils.java