示例#1
0
 @DataProvider
 public Object[][] resolveProvider() {
   return new Object[][] {
     {"dummy.txt", ContentType.textPlain()},
     {"DUMMY.TXT", ContentType.textPlain()},
     {"dummy.html", ContentType.textHtml()},
     {"DUMMY.HTML", ContentType.textHtml()},
     {"DUMMY.", ContentType.applicationOctetStream()},
     {"dummy.xpto", ContentType.applicationOctetStream()},
     {"dontknow", ContentType.applicationOctetStream()}
   };
 }
示例#2
0
 @Test(dataProvider = "resolveProvider")
 public void resolve(String filename, ContentType expected) {
   File file = Directory.JAVA_IO_TMPDIR.fileAt(filename);
   ContentType res = ContentType.resolve(file);
   assertThat(res).equalTo(expected);
 }