use of org.glassfish.jersey.message.internal.ParameterizedHeader in project jersey by jersey.
the class ParameterizedHeadersMapTest method testGetFirst.
/**
* Test of getFirst method, of class ParametrizedHeadersMap.
*/
@Test
public void testGetFirst() throws Exception {
map.add("foo", new ParameterizedHeader("bar"));
map.add("foo", new ParameterizedHeader("baz"));
map.add("foo", new ParameterizedHeader("bop"));
assertEquals(3, map.get("foo").size());
assertEquals("bar", map.getFirst("foo").getValue());
}
use of org.glassfish.jersey.message.internal.ParameterizedHeader in project jersey by jersey.
the class ParameterizedHeadersMapTest method testKeySet.
/**
* Test of keySet method, of class ParametrizedHeadersMap.
*/
@Test
public void testKeySet() throws Exception {
map.add("foo", new ParameterizedHeader("bar"));
map.add("baz", new ParameterizedHeader("bop"));
Set<String> keySet = map.keySet();
assertNotNull(keySet);
assertEquals(2, keySet.size());
assertTrue(keySet.contains("foo"));
assertTrue(!keySet.contains("bar"));
assertTrue(keySet.contains("baz"));
assertTrue(!keySet.contains("bop"));
// TODO - detailed tests for the HeadersKeys methods
}
use of org.glassfish.jersey.message.internal.ParameterizedHeader in project jersey by jersey.
the class ParameterizedHeadersMapTest method testIsEmpty.
/**
* Test of isEmpty method, of class ParametrizedHeadersMap.
*/
@Test
public void testIsEmpty() throws Exception {
assertTrue(map.isEmpty());
map.add("foo", new ParameterizedHeader("bar"));
assertTrue(!map.isEmpty());
map.clear();
assertTrue(map.isEmpty());
}