Skip to content

Update core dependency of appointmentscheduling module#47

Open
sudhanshu-raj wants to merge 2 commits intoopenmrs:masterfrom
sudhanshu-raj:AM-233
Open

Update core dependency of appointmentscheduling module#47
sudhanshu-raj wants to merge 2 commits intoopenmrs:masterfrom
sudhanshu-raj:AM-233

Conversation

@sudhanshu-raj
Copy link

Updated the OpenMRS core dependency to 1.12.0 that meets requirement for ValidationExceptionfrom and also upgraded to Java 8.

See : Jira Link

@chibongho
Copy link

mvn clean install fails for me. The specific command I ran was JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64 mvn clean install (replace JAVA_HOME variable value if needed)

image

@sudhanshu-raj
Copy link
Author

Yes I changed java version , may be it could be that which i reverted back. But the main thing is I still getting test cases errors when changed to openmrs version 1.11.6 , here are logs : Error Logs and other thing I kept getting Junit authentication popup to fill username and password. For the popups i am sure but for errors i tried by adding datasets but that was not enough .

++ @ibacher @mseaton

@ibacher
Copy link
Member

ibacher commented Feb 13, 2026

PUBLIC.APPOINTMENTSCHEDULING_APPOINTMENT FOREIGN KEY(PATIENT_ID) REFERENCES PUBLIC.PATIENT(PATIENT_ID)

This happens because the test datasets don't create patient records and so they assume those patient records are created. There may have been a breaking change in tests between 1.9.9 and 1.11.6, but those are old enough that I don't know that for sure. It's very likely that upgrading this, though, isn't just a matter of bumping the version number. You may also have to do things like ensure that here and in other places we load the standard test dataset if this is accidentally "hiding" the method in BaseModuleContextSensitiveTest that normally would load it or something.

Basically all of these errors look like they derive from the standardDataSet.xml file not being correctly loaded before things are done.

You might get some insight into the kind of changes necessary by looking at the output of this command (run in the openmrs-core project: git diff 1.9.9..1.11.6 api/src/test/java/org/openmrs/test/BaseContextSensitiveTest.java). That will show you the edits made to that file between versions.

@sudhanshu-raj
Copy link
Author

Hi @ibacher , tried to migrate the openmrs from 1.9.9 to 1.11.6 including the newer version of rest module. Thoughts please ?

@sudhanshu-raj sudhanshu-raj reopened this Feb 21, 2026
@sudhanshu-raj
Copy link
Author

Adding a cover for the changes I made:

  • For the API module, I removed the @DirtiesContext because it forces Spring to discard and rebuild the ApplicationContext after each test. In OpenMRS 1.11.6+, test datasets are loaded once at startup and reused across tests for performance. When @DirtiesContext triggers a context rebuild, it clears the existing datasets but fails to properly reload them in the new context. This causes tests to run without the core datasets, leading to authentication failures and missing test data.

  • Added missing parent entity datasets to standardAppointmentTestDataset.xml. Tests previously passed despite missing data due to not strict foreign key enforcement in older Hibernate/H2 versions. Newer versions strictly enforce foreign key constraints, requiring all referenced entities to exist in test data.

  • For OMOD module, in #getDisplayString earlier , this appointmentBlock.getProvider() used to return the provider full name but in newer version, it gives the full object thus implemented the logic to extract the full name manually.

  • Rearranged the row in omod/src/test/resources/standardWebAppointmentTestDataset.xml , in correct ordering making sure child one comes before the parent

  • We are not getting the display bean properly, thus marked it with @PropertyGetter.

@sudhanshu-raj
Copy link
Author

Hey @ibacher , @chibongho @wikumChamith , please review the changes when you get a chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants