Rename headers to header.
This commit is contained in:
parent
0edd98d7a4
commit
7403b04efd
5 changed files with 43 additions and 43 deletions
|
@ -11,12 +11,12 @@ import io.kokuwa.micronaut.logging.http.AbstractFilterTest;
|
|||
import io.micronaut.context.annotation.Property;
|
||||
|
||||
/**
|
||||
* Test for {@link HttpHeadersMdcFilter}.
|
||||
* Test for {@link HeaderMdcFilter}.
|
||||
*
|
||||
* @author Stephan Schnabel
|
||||
*/
|
||||
@DisplayName("http: mdc from headers")
|
||||
public class HttpHeadersMdcFilterTest extends AbstractFilterTest {
|
||||
public class HeaderMdcFilterTest extends AbstractFilterTest {
|
||||
|
||||
@DisplayName("noop: empty configuration")
|
||||
@Test
|
||||
|
@ -26,30 +26,30 @@ public class HttpHeadersMdcFilterTest extends AbstractFilterTest {
|
|||
|
||||
@DisplayName("noop: disabled")
|
||||
@Test
|
||||
@Property(name = "logger.http.headers.enabled", value = "false")
|
||||
@Property(name = "logger.http.headers.names", value = "foo")
|
||||
@Property(name = "logger.http.header.enabled", value = "false")
|
||||
@Property(name = "logger.http.header.names", value = "foo")
|
||||
void noopDisabled() {
|
||||
assertContext(Map.of(), Map.of("foo", "bar"));
|
||||
}
|
||||
|
||||
@DisplayName("mdc: mismatch")
|
||||
@Test
|
||||
@Property(name = "logger.http.headers.names", value = "foo")
|
||||
@Property(name = "logger.http.header.names", value = "foo")
|
||||
void mdcMismatch() {
|
||||
assertContext(Map.of(), Map.of("nope", "bar"));
|
||||
}
|
||||
|
||||
@DisplayName("mdc: match without prefix")
|
||||
@Test
|
||||
@Property(name = "logger.http.headers.names", value = "foo")
|
||||
@Property(name = "logger.http.header.names", value = "foo")
|
||||
void mdcMatchWithoutPrefix() {
|
||||
assertContext(Map.of("foo", "bar"), Map.of("foo", "bar", "nope", "bar"));
|
||||
}
|
||||
|
||||
@DisplayName("mdc: match with prefix")
|
||||
@Test
|
||||
@Property(name = "logger.http.headers.names", value = "foo")
|
||||
@Property(name = "logger.http.headers.prefix", value = "header.")
|
||||
@Property(name = "logger.http.header.names", value = "foo")
|
||||
@Property(name = "logger.http.header.prefix", value = "header.")
|
||||
void mdcMatchWithPrefix() {
|
||||
assertContext(Map.of("header.foo", "bar"), Map.of("foo", "bar", "nope", "bar"));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue