Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-3388

Migrate tests to use JUnit 5

XMLWordPrintable

    Overview

    Tests should be migrated to use JUnit 5. There are some tests currently which already use this, however we should continue this trend.

    This JIRA will act as the parent for the conversion. Each module should have a sub-task created from this JIRA to migrate its tests. Commits should be done one module at a time. Multiple commits may be submitted in a single PR with one exception. The resteasy-testuite migration should be a PR of it's own. It's going to take a lot of work to get these modules done.

    Creating Sub-Taks

    The simplest way to create a sub-task is likely to clone RESTEASY-3389 and make the necessary changes to the description and summary.

    Things to Know

    One of the biggest changes, besides imports and annotation names, is the order of the arguments for Assertions. In JUnit 4 the first parameter was typically a message. This is now the last parameter and may be a Supplier<String>. In some cases using a Supplier<String> might have some benefits if the message is expensive to create or possibly relies on behavior that would cause the object to fail latter on in the test. An example would be reading the output from a jakarta.ws.rs.core.Response. Care will need to taken when using an assertion like Assertions.assertEquals(String, String, String). You'll need to ensure the first argument is NOT the message and is the expected string.

      There are no Sub-Tasks for this issue.

          rsearls r searls
          jperkins-rhn James Perkins
          Votes:
          0 Vote for this issue
          Watchers:
          2 Start watching this issue

            Created:
            Updated:
            Resolved: