Skip to content

Commit

Permalink
Fix incorrect integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
mseaton committed Dec 20, 2024
1 parent d736f9d commit 4bd8690
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ public class GroupFhirResourceProviderIntegrationTest extends BaseFhirR4Integrat

private static final String COHORT_DATA_XML = "org/openmrs/module/fhir2/api/dao/impl/FhirCohortDaoImplTest_initial_data.xml";

private static final String PATIENT_DATA_XML = "org/openmrs/module/fhir2/api/dao/impl/FhirPatientDaoImplTest_initial_data.xml";

private static final String JSON_CREATE_GROUP_DOCUMENT = "org/openmrs/module/fhir2/providers/GroupWebTest_create.json";

private static final String XML_CREATE_GROUP_DOCUMENT = "org/openmrs/module/fhir2/providers/GroupWebTest_create.xml";
Expand All @@ -63,7 +61,6 @@ public class GroupFhirResourceProviderIntegrationTest extends BaseFhirR4Integrat
@Override
public void setup() throws Exception {
super.setup();
executeDataSet(PATIENT_DATA_XML);
executeDataSet(COHORT_DATA_XML);
}

Expand Down Expand Up @@ -387,7 +384,7 @@ public void shouldReturnNotFoundWhenDeletingNonExistentGroup() throws Exception

@Test
public void shouldReturnCountForGroupAsJson() throws Exception {
MockHttpServletResponse response = get("/Group?_summary=count").accept(FhirMediaTypes.JSON).go();
MockHttpServletResponse response = get("/Group").accept(FhirMediaTypes.JSON).go();

assertThat(response, isOk());
assertThat(response.getContentType(), is(FhirMediaTypes.JSON.toString()));
Expand All @@ -402,7 +399,7 @@ public void shouldReturnCountForGroupAsJson() throws Exception {

@Test
public void shouldReturnCountForGroupAsXml() throws Exception {
MockHttpServletResponse response = get("/Group?_summary=count").accept(FhirMediaTypes.XML).go();
MockHttpServletResponse response = get("/Group").accept(FhirMediaTypes.XML).go();

assertThat(response, isOk());
assertThat(response.getContentType(), is(FhirMediaTypes.XML.toString()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,37 @@
graphic logo is a trademark of OpenMRS Inc.
-->
<dataset>
<global_property property="patient.identifierRegex" property_value="^0*@SEARCH@([A-Z]+-[0-9])?$" uuid="c92cce6d-7e7d-4c53-a3c9-faaac17f8f8b"/>
<location location_id="1" name="Test Location" creator="1" date_created="2005-01-01 00:00:00.0" retired="false" uuid="92ab9667-4686-49af-8be8-65a4b58fc49c"/>
<patient_identifier_type patient_identifier_type_id="1" name="Test Identifier Type" description="Test description" creator="1" date_created="2005-01-01 00:00:00.0" required="false" retired="false" uuid="c5576187-9a67-43a7-9b7c-04db22851211"/>
<person person_id="2" gender="M" dead="false" creator="1" date_created="2005-01-01 00:00:00.0" voided="false" uuid="61b38324-e2fd-4feb-95b7-9e9a2a4400df"/>
<person person_id="3" gender="M" dead="true" creator="1" date_created="2005-01-01 00:00:00.0" voided="false" uuid="5c521595-4e12-46b0-8248-b8f2d3697766"/>
<person person_id="4" gender="M" dead="false" creator="1" date_created="2005-01-01 00:00:00.0" voided="false" uuid="256ccf6d-6b41-455c-9be2-51ff4386ae76"/>
<person person_id="5" gender="M" dead="false" creator="1" date_created="2005-01-01 00:00:00.0" voided="false" uuid="30e2aa2a-4ed1-415d-84c5-ba29016c14b7"/>
<person person_id="6" gender="M" dead="false" creator="1" date_created="2005-01-01 00:00:00.0" voided="false" uuid="8d703ff2-c3e2-4070-9737-73e713d5a50d"/>
<person person_id="7" gender="M" dead="false" creator="1" date_created="2005-01-01 00:00:00.0" voided="false" uuid="ca17fcc5-ec96-487f-b9ea-42973c8973e3"/>
<person person_id="8" gender="M" dead="false" creator="1" date_created="2005-01-01 00:00:00.0" voided="false" uuid="c7c1416f9-3beb-40fe-9043-1ce70ea9df53"/>
<person_name person_name_id="2" preferred="true" person_id="2" given_name="John" middle_name="F" family_name="Doe" creator="1" date_created="2005-01-01 00:00:00.0" voided="false" uuid="7e2acadc-5073-4a39-914a-debcbec8c1c9"/>
<person_name person_name_id="3" preferred="true" person_id="3" given_name="I" middle_name="am" family_name="voided" creator="1" date_created="2005-01-01 00:00:00.0" voided="false" uuid="37e60810-0ba9-4f32-ba80-0af59f59e966"/>
<person_name person_name_id="4" preferred="true" person_id="4" given_name="Jean Claude" middle_name=" " family_name="Doe" creator="1" date_created="2005-01-01 00:00:00.0" voided="false" uuid="89232176-29cd-47e5-9ce2-ae375436fb15"/>
<person_name person_name_id="5" preferred="true" person_id="5" given_name="Jean" middle_name=" " family_name="Claude" creator="1" date_created="2005-01-01 00:00:00.0" voided="false" uuid="b33c207b-2096-4023-b0ba-ec3b670e5ba4"/>
<person_name person_name_id="6" preferred="true" person_id="6" given_name="Jeannette" middle_name=" " family_name="Claudent" creator="1" date_created="2005-01-01 00:00:00.0" voided="false" uuid="355d1361-a63d-4897-b853-0f2c389138d0"/>
<person_name person_name_id="7" preferred="true" person_id="7" given_name="John" middle_name="Ho" family_name="Claudio" creator="1" date_created="2005-01-01 00:00:00.0" voided="false" uuid="f7ea8cea-43de-4cff-8a44-21db2aaaabb8"/>
<person_name person_name_id="8" preferred="true" person_id="8" given_name="Carl" middle_name="Oliver" family_name="Charis" creator="1" date_created="2005-01-01 00:00:00.0" voided="false" uuid="c4150da8-cb99-4b77-9483-cb5baf7d4d31"/>
<person_name person_name_id="33" preferred="false" person_id="2" given_name="Some other name" middle_name=" " family_name="Last Name of other name" creator="1" date_created="2004-01-01 00:00:00.0" voided="false" uuid="c9714a2d-a97e-4673-80f8-ac8dd5ced083"/>
<patient patient_id="2" creator="1" date_created="2005-01-01 00:00:00.0" voided="false"/>
<patient patient_id="3" creator="1" date_created="2005-01-01 00:00:00.0" voided="true"/>
<patient patient_id="4" creator="1" date_created="2005-01-01 00:00:00.0" voided="false"/>
<patient patient_id="5" creator="1" date_created="2005-01-01 00:00:00.0" voided="false"/>
<patient patient_id="6" creator="1" date_created="2005-01-01 00:00:00.0" voided="false"/>
<patient patient_id="7" creator="1" date_created="2005-01-01 00:00:00.0" voided="false"/>
<patient patient_id="8" creator="1" date_created="2005-01-01 00:00:00.0" voided="false"/>
<patient_identifier patient_identifier_id="1" patient_id="2" identifier="1234-4" identifier_type="1" preferred="1" location_id="1" creator="1" date_created="2005-01-01 00:00:00.0" voided="false" uuid="e997ac86-4d8a-40f3-bedb-da84d35917b8"/>
<patient_identifier patient_identifier_id="2" patient_id="2" identifier="12345-5" identifier_type="1" preferred="0" location_id="1" creator="1" date_created="2004-01-01 00:00:00.0" voided="false" uuid="504c83c7-cfbf-4ae7-a4da-bdfa3236689f"/>
<patient_identifier patient_identifier_id="3" patient_id="3" identifier="4567-4" identifier_type="1" preferred="1" location_id="1" creator="1" date_created="2005-01-01 00:00:00.0" voided="false" uuid="acc345a8-0ae9-4cad-92ec-7a5b0b25752f"/>
<patient_identifier patient_identifier_id="4" patient_id="4" identifier="5634-1" identifier_type="1" preferred="1" location_id="1" creator="1" date_created="2005-01-01 00:00:00.0" voided="true" uuid="e1bcf220-d116-4d98-93a4-2adf6282f797"/>
<patient_identifier patient_identifier_id="5" patient_id="5" identifier="563422-5" identifier_type="1" preferred="1" location_id="1" creator="1" date_created="2005-01-01 00:00:00.0" voided="false" uuid="f4798e60-b9ef-47d8-afa7-54a1dc9e27c1"/>
<patient_identifier patient_identifier_id="6" patient_id="6" identifier="47622-6" identifier_type="1" preferred="1" location_id="1" creator="1" date_created="2005-01-01 00:00:00.0" voided="false" uuid="86e0b6d5-0f4f-4acd-8c81-edeb985c0ab3"/>
<cohort cohort_id="1" name="John's patientList" description="cohort voided" creator="1" date_created="2005-01-01 00:00:00.0" voided="true" voided_by="1" date_voided="2005-01-01 00:00:00.0" void_reason="This is voided" uuid="985ff1a2-c2ef-49fd-836f-8a1d936d9ef9"/>
<cohort cohort_id="2" name="Covid19 patients" description="Covid19 patients" creator="1" date_created="2005-01-01 00:00:00.0" voided="false" uuid="1d64befb-3b2e-48e5-85f5-353d43e23e46"/>
</dataset>

0 comments on commit 4bd8690

Please sign in to comment.