use of io.vertx.core.http.impl.headers.HeadersMultiMap in project vert.x by eclipse.
the class VertxHttpHeadersTest method testContainsValue3.
@Test
public void testContainsValue3() {
HeadersMultiMap mmap = newMultiMap();
mmap.add("foo", "val1,,val3");
assertTrue(mmap.containsValue("foo", "val1", true));
assertFalse(mmap.containsValue("foo", "val2", true));
assertTrue(mmap.containsValue("foo", "val3", true));
assertFalse(mmap.containsValue("foo", "val4", true));
assertFalse(mmap.containsValue("foo", "helloworld", true));
}
use of io.vertx.core.http.impl.headers.HeadersMultiMap in project vert.x by eclipse.
the class VertxHttpHeadersTest method testContainsValue4.
@Test
public void testContainsValue4() {
HeadersMultiMap mmap = newMultiMap();
mmap.add("foo", "val1, ,val3");
assertTrue(mmap.containsValue("foo", "val1", true));
assertFalse(mmap.containsValue("foo", "val2", true));
assertTrue(mmap.containsValue("foo", "val3", true));
assertFalse(mmap.containsValue("foo", "val4", true));
assertFalse(mmap.containsValue("foo", "helloworld", true));
}
use of io.vertx.core.http.impl.headers.HeadersMultiMap in project java-chassis by ServiceComb.
the class RequestHeaderItemTest method serverFormattedElementIfNotFound.
@Test
public void serverFormattedElementIfNotFound() {
HeadersMultiMap headers = new HeadersMultiMap();
String testValue = "testValue";
headers.add("anotherKey", testValue);
when(routingContext.request()).thenReturn(serverRequest);
when(serverRequest.headers()).thenReturn(headers);
ELEMENT.appendServerFormattedItem(accessLogEvent, strBuilder);
assertEquals("-", strBuilder.toString());
}
use of io.vertx.core.http.impl.headers.HeadersMultiMap in project java-chassis by ServiceComb.
the class RequestHeaderItemTest method serverFormattedElement.
@Test
public void serverFormattedElement() {
HeadersMultiMap headers = new HeadersMultiMap();
String testValue = "testValue";
headers.add(VAR_NAME, testValue);
when(routingContext.request()).thenReturn(serverRequest);
when(serverRequest.headers()).thenReturn(headers);
ELEMENT.appendServerFormattedItem(accessLogEvent, strBuilder);
assertEquals(testValue, strBuilder.toString());
assertEquals(ELEMENT.getVarName(), VAR_NAME);
}
use of io.vertx.core.http.impl.headers.HeadersMultiMap in project java-chassis by ServiceComb.
the class ResponseHeaderItemTest method serverFormattedElement.
@Test
public void serverFormattedElement() {
HeadersMultiMap headers = new HeadersMultiMap();
String headerValue = "headerValue";
headers.add(VAR_NAME, headerValue);
when(routingContext.response()).thenReturn(serverResponse);
when(serverResponse.headers()).thenReturn(headers);
ELEMENT.appendServerFormattedItem(accessLogEvent, strBuilder);
assertEquals(headerValue, strBuilder.toString());
assertEquals(ELEMENT.getVarName(), VAR_NAME);
}
Aggregations