@@ -0,0 +1,2122 @@
+package org.apereo.cas.logging.web;%0A%0Aimport lombok.SneakyThrows;%0Aimport org.apereo.cas.ticket.registry.TicketRegistrySupport;%0Aimport org.apereo.cas.web.support.CookieRetrievingCookieGenerator;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.InjectMocks;%0Aimport org.mockito.Mock;%0Aimport org.mockito.junit.MockitoJUnitRunner;%0Aimport org.springframework.boot.test.context.SpringBootTest;%0Aimport org.springframework.cloud.autoconfigure.RefreshAutoConfiguration;%0Aimport org.springframework.mock.web.MockFilterChain;%0Aimport org.springframework.mock.web.MockHttpServletRequest;%0Aimport org.springframework.mock.web.MockHttpServletResponse;%0A%0Aimport static org.junit.Assert.*;%0A%0A/**%0A * This is %7B@link ThreadContextMDCServletFilterTests%7D.%0A *%0A * @author Misagh Moayyed%0A * @since 5.3.0%0A */%0A@SpringBootTest(classes = RefreshAutoConfiguration.class)%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class ThreadContextMDCServletFilterTests %7B%0A%0A    @Mock%0A    private CookieRetrievingCookieGenerator cookieRetrievingCookieGenerator;%0A%0A    @Mock%0A    private TicketRegistrySupport ticketSupport;%0A    %0A    @InjectMocks%0A    private ThreadContextMDCServletFilter filter;%0A%0A    @Test%0A    @SneakyThrows%0A    public void verifyFilter() %7B%0A        final MockHttpServletRequest request = new MockHttpServletRequest();%0A        request.setRequestURI(%22/cas/login%22);%0A        request.setRemoteAddr(%221.2.3.4%22);%0A        request.setRemoteUser(%22casuser%22);%0A        request.setServerName(%22serverName%22);%0A        request.setServerPort(1000);%0A        request.setContextPath(%22ctxpath%22);%0A        request.setContentType(%22contenttype%22);%0A        request.setRemotePort(2000);%0A        request.setQueryString(%22queryString%22);%0A        request.setMethod(%22method%22);%0A%0A        request.setParameter(%22p1%22, %22v1%22);%0A        request.setAttribute(%22a1%22, %22v1%22);%0A        request.addHeader(%22h1%22, %22v1%22);%0A        %0A        final MockHttpServletResponse response = new MockHttpServletResponse();%0A        final MockFilterChain filterChain = new MockFilterChain();%0A%0A        filter.doFilter(request, response, filterChain);%0A        assertEquals(200, response.getStatus());%0A    %7D%0A%7D%0A

test cases for mdc