Build: #2376 was successful Scheduled with changes by 3 people

Code commits

openmrs-core master

  • Am-Coder <39997970+Am-Coder@users.noreply.github.com>

    Am-Coder <39997970+Am-Coder@users.noreply.github.com> 834f44b7977dd322d09a44b42a1eb6bd8ce33620

    TRUNK-5843 Properly Map sequences via hibernate (#3327)
    * TRUNK-5843 Properly map the sequences via hibernate

    * TRUNK-5843 Properly map the sequences via hibernate

    • api/src/main/resources/org/openmrs/api/db/hibernate/Concept.hbm.xml (version 834f44b7977dd322d09a44b42a1eb6bd8ce33620)
    • api/src/main/resources/org/openmrs/api/db/hibernate/ConceptAttribute.hbm.xml (version 834f44b7977dd322d09a44b42a1eb6bd8ce33620)
    • api/src/main/resources/org/openmrs/api/db/hibernate/ConceptAttributeType.hbm.xml (version 834f44b7977dd322d09a44b42a1eb6bd8ce33620)
    • api/src/main/resources/org/openmrs/api/db/hibernate/EncounterProvider.hbm.xml (version 834f44b7977dd322d09a44b42a1eb6bd8ce33620)
    • api/src/main/resources/org/openmrs/api/db/hibernate/EncounterRole.hbm.xml (version 834f44b7977dd322d09a44b42a1eb6bd8ce33620)
    • api/src/main/resources/org/openmrs/api/db/hibernate/FormResource.hbm.xml (version 834f44b7977dd322d09a44b42a1eb6bd8ce33620)
    • api/src/main/resources/org/openmrs/api/db/hibernate/Provider.hbm.xml (version 834f44b7977dd322d09a44b42a1eb6bd8ce33620)
    • api/src/main/resources/org/openmrs/api/db/hibernate/ProviderAttribute.hbm.xml (version 834f44b7977dd322d09a44b42a1eb6bd8ce33620)
    • api/src/main/resources/org/openmrs/api/db/hibernate/ProviderAttributeType.hbm.xml (version 834f44b7977dd322d09a44b42a1eb6bd8ce33620)
  • teleivo <teleivo@users.noreply.github.com>

    teleivo <teleivo@users.noreply.github.com> 20cec90a006e5bd9d7a0884ee98bdbd8d405564b

    TRUNK-5816 Move helpers into org.openmrs.test.jupiter
    Junit 5 allows us to easily migrate to it also because classes,
    annotations replacing the ones in Junit 4 have the same name but are
    simply in another package called org.junit.jupiter. This is why the
    IntelliJ migration tool only needs to change imports for example for the
    @Test

    We can follow the same approach end provide BaseContext... classes in a
    new package called jupiter. When api tests or module tests migrate they
    just need to update the import and everything else should work as before

    • api/src/test/java/org/openmrs/aop/RequiredDataAdviceTest.java (version 20cec90a006e5bd9d7a0884ee98bdbd8d405564b)
    • api/src/test/java/org/openmrs/api/db/VisitDAOTest.java (version 20cec90a006e5bd9d7a0884ee98bdbd8d405564b)
    • api/src/test/java/org/openmrs/api/impl/PatientServiceImplTest.java (version 20cec90a006e5bd9d7a0884ee98bdbd8d405564b)
    • api/src/test/java/org/openmrs/attribute/AttributeIntegrationTest.java (version 20cec90a006e5bd9d7a0884ee98bdbd8d405564b)
    • api/src/test/java/org/openmrs/module/ModuleExtensionsTest.java (version 20cec90a006e5bd9d7a0884ee98bdbd8d405564b)
    • api/src/test/java/org/openmrs/module/ModuleFileParserUnitTest.java (version 20cec90a006e5bd9d7a0884ee98bdbd8d405564b)
    • api/src/test/java/org/openmrs/propertyeditor/WorkflowCollectionEditorTest.java (version 20cec90a006e5bd9d7a0884ee98bdbd8d405564b)
    • api/src/test/java/org/openmrs/test/BaseContextMockJunit5Test.java (version 20cec90a006e5bd9d7a0884ee98bdbd8d405564b)
    • api/src/test/java/org/openmrs/test/BaseContextSensitiveJunit5Test.java (version 20cec90a006e5bd9d7a0884ee98bdbd8d405564b)
    • api/src/test/java/org/openmrs/test/jupiter/BaseContextMockTest.java (version 20cec90a006e5bd9d7a0884ee98bdbd8d405564b)
    • api/src/test/java/org/openmrs/test/jupiter/BaseContextSensitiveTest.java (version 20cec90a006e5bd9d7a0884ee98bdbd8d405564b)
    • api/src/test/java/org/openmrs/test/jupiter/BaseModuleContextSensitiveTest.java (version 20cec90a006e5bd9d7a0884ee98bdbd8d405564b)
  • achilep <you@example.com>

    achilep <you@example.com> dda2f3e30cb6af46a8c7b8b5766b208ad6e1b60d

    TRUNK-5816: Migrate unit tests to Junit5

    • api/src/test/java/org/openmrs/api/db/VisitDAOTest.java (version dda2f3e30cb6af46a8c7b8b5766b208ad6e1b60d)
    • api/src/test/java/org/openmrs/attribute/AttributeIntegrationTest.java (version dda2f3e30cb6af46a8c7b8b5766b208ad6e1b60d)
    • api/src/test/java/org/openmrs/propertyeditor/WorkflowCollectionEditorTest.java (version dda2f3e30cb6af46a8c7b8b5766b208ad6e1b60d)
    • api/src/test/java/org/openmrs/test/BaseContextSensitiveJunit5Test.java (version dda2f3e30cb6af46a8c7b8b5766b208ad6e1b60d)
  • teleivo <teleivo@users.noreply.github.com>

    teleivo <teleivo@users.noreply.github.com> a7aee4bf0bc3455124dff6a62b7857b0c7514b97

    TRUNK-5816 Update IntelliJ live templates
    you can create a link to this file into the IntelliJ templates folder
    like for example

    ln -s ~/code/openmrs/openmrs-core/tools/src/main/resources/intellij/templates.xml ~/Library/ApplicationSupport/JetBrains/IdeaIC2020.1/templates/OpenMRS.xml

    Adjust the paths to your local path structure and the IntelliJ version
    you have installed. You might need to restart Intellij after that you
    should see them in the Settings Live Templates under the group OpenMRS

    In a test file for example write testException and hit enter. This
    should insert a junit test using assertThrows

    • tools/src/main/resources/intellij/templates.xml (version a7aee4bf0bc3455124dff6a62b7857b0c7514b97)
  • teleivo <teleivo@users.noreply.github.com>

    teleivo <teleivo@users.noreply.github.com> 68f17d66bdf2849978e09d69a0570b88b69f0c9d

    TRUNK-5816 Use MockitoExtension
    Extensions are the Junit 5 way of extending its capabilities.
    MockitoExtension is setup strict by default which is very useful in that
    it shows us unnecessary stubs like

    org.mockito.exceptions.misusing.UnnecessaryStubbingException:
    Unnecessary stubbings detected.
    Clean & maintainable test code requires zero unnecessary code.
    Following stubbings are unnecessary (click to navigate to relevant line of code):
      1. -> at org.openmrs.api.impl.PatientServiceImplTest.checkPatientIdentifiers_shouldThrowDuplicateIdentifierGivenDuplicateIdentifiers(PatientServiceImplTest.java:165)
    Please remove unnecessary stubbings or use 'lenient' strictness. More info: javadoc for UnnecessaryStubbingException class.

    this helps us clean up our tests that have had mocks added over time but
    not removed once not needed anymore.

    MockitoExtension also allows us to inject mocks in constructor/test
    methods

    Note that we did setup the mocked
    userContext.getAuthenticatedUser() in the ContextHelper as lenient so
    that this mock that all

    BaseContextSensitiveTest
    BaseContextMockTest
    BaseContextMockJunit5Test

    get does not cause such errors if not used

    • api/pom.xml (version 68f17d66bdf2849978e09d69a0570b88b69f0c9d)
    • api/src/test/java/org/openmrs/aop/RequiredDataAdviceTest.java (version 68f17d66bdf2849978e09d69a0570b88b69f0c9d)
    • api/src/test/java/org/openmrs/api/impl/PatientServiceImplTest.java (version 68f17d66bdf2849978e09d69a0570b88b69f0c9d)
    • api/src/test/java/org/openmrs/test/BaseContextMockJunit5Test.java (version 68f17d66bdf2849978e09d69a0570b88b69f0c9d)
  • achilep <you@example.com>

    achilep <you@example.com> 0a9f1854ccc847955602c2212e67bc7baf7b1414

    TRUNK-5816: Migrate api package tests to Junit 5

    • api/src/test/java/org/openmrs/aop/RequiredDataAdviceTest.java (version 0a9f1854ccc847955602c2212e67bc7baf7b1414)
    • api/src/test/java/org/openmrs/api/impl/PatientServiceImplTest.java (version 0a9f1854ccc847955602c2212e67bc7baf7b1414)
    • api/src/test/java/org/openmrs/module/ModuleExtensionsTest.java (version 0a9f1854ccc847955602c2212e67bc7baf7b1414)
    • api/src/test/java/org/openmrs/module/ModuleFileParserUnitTest.java (version 0a9f1854ccc847955602c2212e67bc7baf7b1414)
    • api/src/test/java/org/openmrs/test/BaseContextMockJunit5Test.java (version 0a9f1854ccc847955602c2212e67bc7baf7b1414)
  • achilep <you@example.com>

    achilep <you@example.com> 9ddba4575317c65795b0846783b1f9a58a39f610

    TRUNK-5816: Migrate api package tests to Junit 5

    • api/src/test/java/org/openmrs/OrderGroupTest.java (version 9ddba4575317c65795b0846783b1f9a58a39f610)
    • api/src/test/java/org/openmrs/OrderTypeTest.java (version 9ddba4575317c65795b0846783b1f9a58a39f610)
    • api/src/test/java/org/openmrs/PatientProgramTest.java (version 9ddba4575317c65795b0846783b1f9a58a39f610)
    • api/src/test/java/org/openmrs/PatientStateTest.java (version 9ddba4575317c65795b0846783b1f9a58a39f610)
    • api/src/test/java/org/openmrs/PatientTest.java (version 9ddba4575317c65795b0846783b1f9a58a39f610)
    • api/src/test/java/org/openmrs/PersonAddressTest.java (version 9ddba4575317c65795b0846783b1f9a58a39f610)
    • api/src/test/java/org/openmrs/PersonNameTest.java (version 9ddba4575317c65795b0846783b1f9a58a39f610)