This is an automated email from the ASF dual-hosted git repository. rcordier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 7475d71b8f7b839c6d42ffa5a7c45c40fa434e9e Author: Rene Cordier <[email protected]> AuthorDate: Fri Jul 17 11:04:29 2020 +0700 [Refactoring] Migrate PDFTextExtractorTest to JUnit5 --- .../mailbox/store/search/PDFTextExtractorTest.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/PDFTextExtractorTest.java b/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/PDFTextExtractorTest.java index de4bac9..658bdcf 100644 --- a/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/PDFTextExtractorTest.java +++ b/mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/PDFTextExtractorTest.java @@ -27,34 +27,34 @@ import java.io.InputStream; import java.nio.charset.StandardCharsets; import org.apache.james.mailbox.model.ContentType; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; -public class PDFTextExtractorTest { +class PDFTextExtractorTest { - private PDFTextExtractor testee; + PDFTextExtractor testee; - @Before - public void setUp() { + @BeforeEach + void setUp() { testee = new PDFTextExtractor(); } @Test - public void extractContentShouldThrowWhenNullInputStream() throws Exception { + void extractContentShouldThrowWhenNullInputStream() { assertThatThrownBy(() -> testee.extractContent(null, ContentType.of("any/any"))) .isInstanceOf(NullPointerException.class); } @Test - public void extractContentShouldThrowWhenNullContentType() throws Exception { + void extractContentShouldThrowWhenNullContentType() { InputStream inputStream = new ByteArrayInputStream("content".getBytes(StandardCharsets.UTF_8)); assertThatThrownBy(() -> testee.extractContent(inputStream, null)) .isInstanceOf(NullPointerException.class); } @Test - public void extractContentShouldExtractPlainText() throws Exception { + void extractContentShouldExtractPlainText() throws Exception { String content = "content"; InputStream inputStream = new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)); @@ -64,7 +64,7 @@ public class PDFTextExtractorTest { } @Test - public void extractContentShouldExtractPDF() throws Exception { + void extractContentShouldExtractPDF() throws Exception { String content = "Little PDF\n"; InputStream inputStream = ClassLoader.getSystemResourceAsStream("pdf.pdf"); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
