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

Build result summary

Details

Completed
Queue duration
2 seconds
Duration
1 minute
Labels
None
Revision
834f44b7977dd322d09a44b42a1eb6bd8ce33620 834f44b7977dd322d09a44b42a1eb6bd8ce33620
Successful since
#1742 ()

Code commits

Author Commit Message Commit date
Am-Coder <39997970+Am-Coder@users.noreply.github.com> Am-Coder <39997970+Am-Coder@users.noreply.github.com> 834f44b7977dd322d09a44b42a1eb6bd8ce33620 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
teleivo <teleivo@users.noreply.github.com> teleivo <teleivo@users.noreply.github.com> 20cec90a006e5bd9d7a0884ee98bdbd8d405564b 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
achilep <you@example.com> achilep <you@example.com> dda2f3e30cb6af46a8c7b8b5766b208ad6e1b60d dda2f3e30cb6af46a8c7b8b5766b208ad6e1b60d TRUNK-5816: Migrate unit tests to Junit5
teleivo <teleivo@users.noreply.github.com> teleivo <teleivo@users.noreply.github.com> a7aee4bf0bc3455124dff6a62b7857b0c7514b97 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
teleivo <teleivo@users.noreply.github.com> teleivo <teleivo@users.noreply.github.com> 68f17d66bdf2849978e09d69a0570b88b69f0c9d 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

Jira issues

IssueDescriptionStatus
Unknown Issue TypeTRUNK-5816Could not obtain issue details from Jira
Unknown Issue TypeTRUNK-5843Could not obtain issue details from Jira