@Test
    void verifyParam() {
        filter.init(filterConfig);

        val servletRequest = new MockHttpServletRequest();
        servletRequest.setSecure(true);
        val servletResponse = new MockHttpServletResponse();
        assertThrows(RuntimeException.class, () -> filter.doFilter(servletRequest, servletResponse, null));
        assertDoesNotThrow(() -> filter.doFilter(servletRequest, servletResponse, new MockFilterChain()));
        filter.destroy();
        assertNotNull(servletResponse.getHeaderValue("Cache-Control"));
        assertNotNull(servletResponse.getHeaderValue("Pragma"));
        assertNotNull(servletResponse.getHeaderValue("Expires"));
        assertNotNull(servletResponse.getHeaderValue("Content-Security-Policy"));
        assertNotNull(servletResponse.getHeaderValue("X-XSS-Protection"));
        assertNotNull(servletResponse.getHeaderValue("X-Frame-Options"));
        assertNotNull(servletResponse.getHeaderValue("X-Content-Type-Options"));
        assertNotNull(servletResponse.getHeaderValue("Strict-Transport-Security"));
    }
This is {@link ResponseHeadersEnforcementFilterTests}.

@author Misagh Moayyed
@since 6.2.0
core/cas-server-core-web-api/src/test/java/org/apereo/cas/web/support/filters/ResponseHeadersEnforcementFilterTests.java