Skip to content

Migrate tests to JUnit5#214

Merged
garydgregory merged 1 commit intoapache:masterfrom
strangelookingnerd:migrate_junit5
Jan 7, 2025
Merged

Migrate tests to JUnit5#214
garydgregory merged 1 commit intoapache:masterfrom
strangelookingnerd:migrate_junit5

Conversation

@strangelookingnerd
Copy link
Contributor

Migrates tests to JUnit5. Changes include

  • Updated JUnit dependency
  • Replaced usage of junit.framework.* for the JUnit5 equivalents
  • Flipped order of parameters for some assertions comparing the expected vs. actual values
  • Simplified some assertions, e.g. assertEquals(null, object) becomes assertNull(object)

There would be plenty of other possible improvements and best-practises that were not implemented in order to keep the changeset minimal. If desired I could add these as well in a separate PR.

Verified with mvn clean verify that build passes before and after my changes.
Overall number of tests and coverage did not change. Note that org.apache.commons.jxpath.ri.model.jdom.JDOMModelTest#testID did not do anything so I chose to use @Disabled with a meaningful message.

@garydgregory garydgregory merged commit cf1d848 into apache:master Jan 7, 2025
16 of 17 checks passed
@garydgregory
Copy link
Member

@strangelookingnerd
Merged! TY. One task I'd like to see done is using assertThrows instead of custom try-catch blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants