Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-5811 Update Junit from 4 to 5
  3. TRUNK-5818

Enable module devs to write Junit 4 & 5 tests

    XMLWordPrintable

Details

    • Sub-task
    • Status: Closed
    • TBD
    • Resolution: Fixed
    • None
    • Core 2.4.0
    • None
    • None
    • Undetermined

    Description

      Unclear

      there are all these helpers

      BaseContextMockTest
      BaseContextSensitiveTest
      BaseModuleContextSensitiveTest
      BaseWebContextSensitiveTest
      BaseModuleWebContextSensitiveTest

      that are based on Junit 4

      {{public abstract class BaseContextSensitiveTest extends AbstractJUnit4SpringContextTests { }}
      BaseContextMockTest is pre Junit 5 Extensions

      Also what dependencies do we need to provide in openmrs-test? Might be Junit 4.13, unit 5 junit-jupiter-api, junit-jupiter-engine, junit-vintage-engine. What about the Mockito Extension?

      Goal

      After we have migrated all openmrs-core tests to Junit 5 we should

      • make sure that module developers can still run there Junit 4 tests
      • but could also gradually migrate tests over to Junit 5

      Documentation

      We should help module developers to migrate by providing a gist of what we learned while migrating openmrs-core.

      Write up a short confluence document outlining what needs to be done. Here is a draft of such a doc https://wiki.openmrs.org/display/docs/How+to+migrate+to+JUnit+5

      Write a post on talk.openmrs.org/ linking to the document.

      Potentially migrate a module to show how this is done.

      Ideas

      Provide an IntelliJ migration based of the Junit 5 one so that the openmrs helper classes are automatically migrated

      Gliffy Diagrams

        Attachments

          Issue Links

            Activity

              People

                achilep Pahonsi Bebeto Achile
                achilep Pahonsi Bebeto Achile
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: