@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()} }; }
@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); }