JSON-java icon indicating copy to clipboard operation
JSON-java copied to clipboard

Migrating to Junit 5

Open anudeepikamunnangi opened this issue 1 year ago • 7 comments

I tried to upgraded the code base to Junit 5 to get new features for unit testing. Below are the steps, I followed :

Steps:

  1. Upgrading dependencies in maven and gradle
  2. Changing Packages
    1. org.junit.Test to org.junit.jupiter.api.Test
    2. org.junit.Assert.* to org.junit.jupiter.api.Assertions.*
  3. Junit 4(message,value) Parameter changes to Junit 5 (value ,message ).
  4. Better Exception Handling. (https://www.baeldung.com/junit-assert-exception)
  5. @Rule and @ClassRule in JUnit 4 should be done with @ExtendWith and Extension
  6. @Ignore to @Disabled https://www.softwaretestinghelp.com/junit-ignore-test-cases/
  7. @RunsWith Parameterized should be done with @ExtendWith (https://www.baeldung.com/parameterized-tests-junit-5)

anudeepikamunnangi avatar Jan 03 '24 15:01 anudeepikamunnangi