private RegisteredServiceResponseHeadersEnforcementFilter getFilterForProperty(
        final String serviceId,
        final Pair<RegisteredServiceProperties, String>... properties) {

        val service = RegisteredServiceTestUtils.getRegisteredService(serviceId, Map.of());
        val props1 = new LinkedHashMap<String, RegisteredServiceProperty>();
        for (val property : properties) {
            val prop1 = new DefaultRegisteredServiceProperty();
            prop1.addValue(property.getValue());
            props1.put(property.getKey().getPropertyName(), prop1);
        }
        service.setProperties(props1);
        servicesManager.save(service);

        return new RegisteredServiceResponseHeadersEnforcementFilter(
            new DirectObjectProvider<>(servicesManager),
            new DirectObjectProvider<>(argumentExtractor),
            new DirectObjectProvider<>(new DefaultAuthenticationServiceSelectionPlan(new DefaultAuthenticationServiceSelectionStrategy())),
            new DirectObjectProvider<>(new RegisteredServiceAccessStrategyAuditableEnforcer(applicationContext, principalAccessStrategyEnforcer)),
            webEndpointProperties);
    }
This is {@link RegisteredServiceResponseHeadersEnforcementFilterTests}.

@author Misagh Moayyed
@since 5.3.0
core/cas-server-core-web/src/test/java/org/apereo/cas/web/RegisteredServiceResponseHeadersEnforcementFilterTests.java