added request method to mdc filter

This commit is contained in:
Sebastian Sdorra
2016-06-28 12:06:28 +02:00
parent 7ef8e1ebd5
commit 7d8613b6bb
2 changed files with 8 additions and 0 deletions

View File

@@ -87,6 +87,7 @@ public class MDCFilterTest extends AbstractTestBase {
when(request.getRequestURI()).thenReturn("api/v1/repositories");
when(request.getRemoteAddr()).thenReturn("127.0.0.1");
when(request.getRemoteHost()).thenReturn("localhost");
when(request.getMethod()).thenReturn("GET");
MDCCapturingFilterChain chain = new MDCCapturingFilterChain();
filter.doFilter(request, response, chain);
@@ -96,6 +97,7 @@ public class MDCFilterTest extends AbstractTestBase {
assertEquals("api/v1/repositories", chain.ctx.get(MDCFilter.MDC_REQUEST_URI));
assertEquals("127.0.0.1", chain.ctx.get(MDCFilter.MDC_CLIEN_IP));
assertEquals("localhost", chain.ctx.get(MDCFilter.MDC_CLIEN_HOST));
assertEquals("GET", chain.ctx.get(MDCFilter.MDC_REQUEST_METHOD));
}
/**