* Tests checking correct handling of parameters and default values
*/
@Test
public void checkMediaTypeForStreamSource() throws IOException {
ContentSource source = new StreamSource(new ByteArrayInputStream(DATA));
assertEquals(DEFAULT_MT, source.getMediaType());
source = new StreamSource(new ByteArrayInputStream(DATA),null);
assertEquals(DEFAULT_MT, source.getMediaType());
source = new StreamSource(new ByteArrayInputStream(DATA),null,HEADERS);
assertEquals(DEFAULT_MT, source.getMediaType());
source = new StreamSource(new ByteArrayInputStream(DATA),null,FILE_NAME,HEADERS);
assertEquals(DEFAULT_MT, source.getMediaType());
source = new StreamSource(new ByteArrayInputStream(DATA),MT);
assertEquals(MT, source.getMediaType());
source = new StreamSource(new ByteArrayInputStream(DATA),MT,HEADERS);
assertEquals(MT, source.getMediaType());
source = new StreamSource(new ByteArrayInputStream(DATA),MT,FILE_NAME,HEADERS);
assertEquals(MT, source.getMediaType());
//Parameters MUST BE preserved!
source = new StreamSource(new ByteArrayInputStream(DATA),MT_WITH_PARAM);
assertEquals(MT_WITH_PARAM, source.getMediaType());
source = new StreamSource(new ByteArrayInputStream(DATA),MT_WITH_PARAM,HEADERS);
assertEquals(MT_WITH_PARAM, source.getMediaType());
source = new StreamSource(new ByteArrayInputStream(DATA),MT_WITH_PARAM,FILE_NAME,HEADERS);
assertEquals(MT_WITH_PARAM, source.getMediaType());
}