Okay… that wasn’t easy.
First of all you can remove the bean for
EncounterTransactionMapper in TestingApplicationContext.xml. I didn’t have the full view of the errors when I gave you this info.
Below is what I had to do step by step, to fix the current api-2.0 setup for Spring Tests. Note that all the changes are made to api-2.0/pom.xml, specific versions are upped through introducing overriding properties in that file (so here, not in the root pom.xml).
Adding a test dependency on reportingcompatibility-api 2.0.1.
This fixes the
ClassNotFoundException: AbstractReportObject. Digging around the repos shows that this guy lives in the Reporting Compatibility module and that the first release to carry it is version 2.0.1.
Adding a test dependency on emrapi-api-1.12.
This clears the
NoSuchBeanDefinitionException: No bean named 'drugMapper' is defined error. If you look at the EMR API module, you will see that
DrugMapper is an interface and that you need at least the 1.12 subproject to get a 2.x friendly implementations of it to be found by Spring (see here).
Upping EMR API to 1.16.
It is the first version of the module that contains the above subproject and that does not carry anymore the snapshot dependency on the Ref App distro project.
Adding a test dependency on serialization.xstream-api-2.0.
This resolves the error:
NoClassDefFoundError: org/hibernate/collection/PersistentCollection. Looking in the details of the stack trace for this class definition that is not found shows hints that it’s through the Serialization Xstream module that the problem arises.
This is the first version of the module that brings the needed 2.0 subproject.
reportingVersion to 1.15.0 to make go away the references to
PatientSetService. See TRUNK-4874.
More specifically I was getting this error:
You should really try to go through all this on your side, to get a sense of how each of those problems is solved. They are quite typical of OpenMRS and its modules, so that might be useful again in other contexts.