You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2022/02/16 17:47:53 UTC

[GitHub] [accumulo] DomGarguilo edited a comment on issue #2441: Migrate from JUnit 4 to JUnit 5

DomGarguilo edited a comment on issue #2441:
URL: https://github.com/apache/accumulo/issues/2441#issuecomment-1041908425


   Here are some quick notes that might help to reference for those who work on the migration or for reviewers.
   
   | JUnit4  | JUnit5  |
   | ----------- | ----------- |
   | `@Test` | `@Test` |
   | `@Before` | `@BeforeEach` |
   | `@After` | `@AfterEach` |
   | `@BeforeClass` | `@BeforeAll` |
   | `@AfterClass` | `AfterAll` |
   | `@Ignore` | `@Disable` |
   | `@Category` | `@Tag` |
   
   | | JUnit4  | JUnit5  |
   | ----------- | ----------- | ----------- |
   | Testing class package | `org.junit` | `org.junit.jupiter.api` |
   | Assertions class | `Assert` | `Assertions` |
   
   `TemporaryFolder` was removed and instead a `File` or `Path` is used in JUnit5 with the `@TempDir` annotation.
   
   Additionally, the order of parameters in assert statements has changed. The optional message is now the last parameter rather than the first parameter. e.g. `assertTrue("should be equal", 1==3)` becomes `assertTrue(1==3, "should be equal")` 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org