コード例 #1
0
ファイル: ContentTypeTest.java プロジェクト: objectos/rio
 @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
ファイル: ContentTypeTest.java プロジェクト: objectos/rio
 @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);
 }