use of io.vertx.core.http.CaseInsensitiveHeaders in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testMapEntrySetValue.
/*
* unit tests for public method in MapEntry
* (isn't actually used in the implementation)
*/
@Test
public void testMapEntrySetValue() throws Exception {
MultiMap mmap = new CaseInsensitiveHeaders();
mmap.add("Header", "oldvalue");
for (Map.Entry<String, String> me : mmap) {
me.setValue("newvalue");
}
assertEquals("newvalue", mmap.get("Header"));
}
use of io.vertx.core.http.CaseInsensitiveHeaders in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testContainsTest2.
@Test
public void testContainsTest2() throws Exception {
MultiMap mmap = new CaseInsensitiveHeaders();
String name = "";
assertFalse(mmap.contains(name));
}
use of io.vertx.core.http.CaseInsensitiveHeaders in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testAddMultiMap.
@Test
public void testAddMultiMap() throws Exception {
MultiMap mmap = new CaseInsensitiveHeaders();
MultiMap mm = new CaseInsensitiveHeaders();
mm.add("Header1", "value1");
mm.add("Header2", "value2");
MultiMap result = mmap.addAll(mm);
assertEquals(2, result.size());
assertEquals("Header1: value1\nHeader2: value2\n", result.toString());
}
use of io.vertx.core.http.CaseInsensitiveHeaders in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testRemoveTest2.
@Test
public void testRemoveTest2() throws Exception {
MultiMap mmap = new CaseInsensitiveHeaders();
String name = "1";
MultiMap result = mmap.remove(name);
assertNotNull(result);
assertTrue(result.isEmpty());
assertEquals(0, result.size());
}
use of io.vertx.core.http.CaseInsensitiveHeaders in project vert.x by eclipse.
the class CaseInsensitiveHeadersTest method testRemoveTest4.
@Test
public void testRemoveTest4() throws Exception {
MultiMap mmap = new CaseInsensitiveHeaders();
String name = "name";
String value = "value";
mmap.add(name, value);
assertTrue(mmap.contains(name));
MultiMap result = mmap.remove(name);
assertFalse(result.contains(name));
}
Aggregations