use of org.glassfish.jersey.message.internal.QualitySourceMediaType in project jersey by jersey.
the class QualitySourceMediaTypeProviderTest method testMultipleMediaTypeWithQuality.
@Test
public void testMultipleMediaTypeWithQuality() throws Exception {
final String header = "application/xml;qs=0.1, text/xml;qs=0.2, text/html;qs=0.3";
final List<QualitySourceMediaType> l = HttpHeaderReader.readQualitySourceMediaType(header);
assertEquals(3, l.size());
MediaType m;
m = l.get(0);
assertEquals("text", m.getType());
assertEquals("html", m.getSubtype());
assertEquals(1, m.getParameters().size());
m = l.get(1);
assertEquals("text", m.getType());
assertEquals("xml", m.getSubtype());
assertEquals(1, m.getParameters().size());
m = l.get(2);
assertEquals("application", m.getType());
assertEquals("xml", m.getSubtype());
assertEquals(1, m.getParameters().size());
}
Aggregations