@raff Thanks. In the first failing test it shows following error.
“saveObs_shouldCascadeUpdateToNewChildObsGroups(org.openmrs.api.ObsServiceTest) Time elapsed: 0.174 sec <<< ERROR!
org.openmrs.api.ValidationException: ‘Obs #2’ failed to validate with reason: person: person objects of the obs and the encounter do not match”
I find it hard to understand why the exception occurs?
@raff I modified the code with your line. But it still caused the same exception.
Digging into the matter showed me that an encounter with a different patient is auto assigned to the origParentObs which causes the exception. Here are the details.
in the test method
origParentObs id =2,
origParentObs encounter = null,
origParentObs person = Patient#2
in the new validation in ObsValidator.java
origParentObs id =9,
origParentObs encounter = Encounter: [3 2008-08-01 00:00:00.0 Emergency Unknown Location 7 Basic Form num Obs: [Obs #7] num Orders: 3 ],
origParentObs person = Person(personId=9)