Skip to content

Commit 7d2c35f

Browse files
fix unit tests to ensure search by resource meta.source works properly (#7209)
* [7206] fix unit tests to ensure search by resource meta.source works properly --------- Co-authored-by: volodymyr <[email protected]>
1 parent aea260c commit 7d2c35f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

hapi-fhir-jpaserver-test-utilities/src/main/java/ca/uhn/fhir/jpa/search/BaseSourceSearchParameterTestCases.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public void testSearch_withRequestIdAndSource_returnsCorrectBundle() {
102102
pt2id);
103103
}
104104

105+
@EnabledIf("isRequestIdSupported")
105106
@Test
106107
public void testSearchSource_whenSameSourceForMultipleResourceTypes_willMatchSearchResourceTypeOnly() {
107108
String sourceUrn = "http://host/0";
@@ -111,11 +112,12 @@ public void testSearchSource_whenSameSourceForMultipleResourceTypes_willMatchSea
111112
IIdType ob0id = createObservation(withSource(sourceUrn), withStatus("final"));
112113

113114
myTestDaoSearch.assertSearchFinds(
114-
"search source URI for Patient finds", "Patient?_source=http://host/0", pt0id);
115+
"search source URI for Patient finds", "Patient?_source=http://host/0#a_request_id", pt0id);
115116
myTestDaoSearch.assertSearchNotFound(
116117
"search source URI for Patient - Observation not found", "Patient?_source=http://host/0", ob0id);
117118
}
118119

120+
@EnabledIf("isRequestIdSupported")
119121
@Test
120122
public void testSearchSource_withOrJoinedParameter_returnsUnionResultBundle() {
121123
myTestDataBuilder.setRequestId("a_request_id");
@@ -125,7 +127,10 @@ public void testSearchSource_withOrJoinedParameter_returnsUnionResultBundle() {
125127
createPatient(withSource("http://host/2"), withActiveTrue());
126128

127129
myTestDaoSearch.assertSearchFinds(
128-
"search source URI with union", "Patient?_source=http://host/0,http://host/1", pt0id, pt1id);
130+
"search source URI with union",
131+
"Patient?_source=http://host/0#a_request_id,http://host/1#a_request_id",
132+
pt0id,
133+
pt1id);
129134
}
130135

131136
@EnabledIf("isRequestIdSupported")

0 commit comments

Comments
 (0)