Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: extensions in patient doesn't ensure orders #6544

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SijieMei
Copy link
Contributor

@SijieMei SijieMei commented Dec 7, 2024

Issues

The methods testValidateWithExtensionsJson and testValidateWithExtensionsXml in ResourceValidatorDstu2_1Test and ResourceValidatorDstu3Test may encounter potential issues due to the usage of assertThat(messageString).containsSubsequence(). This assertion could fail in certain environments.

090d6cb6b43555534530c0e4d00959f

Reason

The fields "Organization/2.25.79433498044103547197447759549862032393", "furry-grey", and "furry-white" are extension fields in PatientProfileDstu2_1. These fields do not have an explicit order annotation in PatientProfileDstu2_1. (like order=9)

image

In this context, BaseRuntimeElementCompositeDefinition relies on the default field order provided by getDeclaredFields. However, the order of fields returned by getDeclaredFields is not guaranteed and can vary between different JVM implementations.

Due to this, the test assertion using containsSubsequence is unable to reliably ensure the order of the fields, leading to potential inconsistencies.

image

Change

instead of introducing explicit order annotations for these fields, I have updated the test to use contains instead of containsSubsequence. Please let me know if further adjustments are needed. Thank you!

Copy link

codecov bot commented Dec 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.20%. Comparing base (406db33) to head (3fc20d0).
Report is 123 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6544      +/-   ##
============================================
- Coverage     83.54%   83.20%   -0.34%     
- Complexity    27432    28068     +636     
============================================
  Files          1707     1771      +64     
  Lines        106185   109487    +3302     
  Branches      13397    13792     +395     
============================================
+ Hits          88710    91101    +2391     
- Misses        11750    12455     +705     
- Partials       5725     5931     +206     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

1 participant