@BeforeEach
    void initialize() {
        this.registeredService = mock(RegisteredService.class);
        when(registeredService.getId()).thenReturn(1L);
        when(registeredService.getServiceId()).thenReturn("https://www.google.com/.+");
        when(registeredService.getAccessStrategy()).thenReturn(new DefaultRegisteredServiceAccessStrategy());
        when(registeredService.getPublicKey()).thenReturn(new RegisteredServicePublicKeyImpl("classpath:keys/RSA1024Public.key", "RSA"));

        this.webApplicationService = mock(WebApplicationService.class);
        when(webApplicationService.getId()).thenReturn("https://www.google.com/");
        when(webApplicationService.getOriginalUrl()).thenReturn("https://www.google.com/");
        when(webApplicationService.getFormat()).thenReturn(ValidationResponseType.XML);
    }
This is {@link DefaultCasProtocolAttributeEncoderTests}.

@author Misagh Moayyed
@since 6.0.0
core/cas-server-core-services-authentication/src/test/java/org/apereo/cas/authentication/support/DefaultCasProtocolAttributeEncoderTests.java