Build: #2274 was successful
Job: Integration Test was successful
Code commits
openmrs-core
-
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)