JSON-java
JSON-java copied to clipboard
Migrating to Junit 5
I tried to upgraded the code base to Junit 5 to get new features for unit testing. Below are the steps, I followed :
Steps:
- Upgrading dependencies in maven and gradle
- Changing Packages
- org.junit.Test to org.junit.jupiter.api.Test
- org.junit.Assert.* to org.junit.jupiter.api.Assertions.*
- Junit 4(message,value) Parameter changes to Junit 5 (value ,message ).
- Better Exception Handling. (https://www.baeldung.com/junit-assert-exception)
- @Rule and @ClassRule in JUnit 4 should be done with @ExtendWith and Extension
- @Ignore to @Disabled https://www.softwaretestinghelp.com/junit-ignore-test-cases/
- @RunsWith Parameterized should be done with @ExtendWith (https://www.baeldung.com/parameterized-tests-junit-5)