test: Implement comprehensive integration tests for ReferralSetService and strict assertions - #4110
Open
Agaba-derrick wants to merge 4 commits into
Conversation
|
👋 Hi, @Agaba-derrick, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
…e and strict assertions
Agaba-derrick
force-pushed
the
feat/referral-set-service-integration-tests
branch
from
August 21, 2026 16:13
2a79153 to
a674d68
Compare
HerbertYiga
reviewed
Aug 27, 2026
| } | ||
|
|
||
| @Test | ||
| public void updateReferralSets_shouldUpdateExistingReferralResultAndResult() { |
Contributor
There was a problem hiding this comment.
is this supposed to be updateReferralSets_shouldUpdateExistingReferralResult()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Requests Requirements
Issue number if applicable.
Styleguide and Design
documentation.
Guidelines of this
project.
Summary
This PR introduces robust integration tests for the
referralmodule while eliminating weak assertions to align with strict validation standards.1. Comprehensive
ReferralSetServiceTestsupdateReferralSets, thoroughly testing result persistence, result editing, and cascading soft deletions.Noteinsertions strictly abide byduplicateNoteExistsconstraints (Note.INTERNALandreferenceTableId = "24").Sampletransitions to aFinishedstatus only when all related sibling analyses are finalized and results are non-blank.testdata/referral-set.xmlwith accuratestatus_of_sampledictionary definitions and addedstatusService.refreshCache()to properly sync test execution states and avoid lookup errors.updateReferralSetstest cases with an existingReferralSetServiceTest.javafile (created forcreateSaveReferralSetsSamplePatientEntry) to consolidate tests into a single file and prevent CI pipeline fragmentation.2. Strict Assertion Enforcement ("No Null/NotNull" Rule)
ReferralTypeServiceTest.java: Refactored the entire file to completely remove allassertNotNull()checks, replacing them with exactassertEquals(...)verifications of returned values.ReferralSetServiceTest.java: Eliminated allassertNull()checks. Deletion validations now rely on strong list-state assertions (using.anyMatch(...) == false) to explicitly guarantee the entity's absence from the active dataset.3. Code Polish & Formatting
// Execute,// Setup).mvn spotless:applyacross all modified classes.Screenshots
Related Issue
Closes #4109 4109
Other