Skip to content

Commit

Permalink
FM2-327: Improve the Tests for FhirRelatedPersonDaoImplTest (#315)
Browse files Browse the repository at this point in the history
Co-authored-by: Ian <52504170+ibacher@users.noreply.github.com>
  • Loading branch information
theanandankit and ibacher committed Feb 10, 2021
1 parent 6ca1460 commit cb69c3e
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ public class FhirRelatedPersonDaoImplTest extends BaseModuleContextSensitiveTest

private static final String BAD_RELATIONSHIP_UUID = "d4c91630-8563-481b-8efa-48e10c139w6e";

private static final String PERSON_A_UUID = "61b38324-e2fd-4feb-95b7-9e9a2a4400df";

private static final String PERSON_B_UUID = "5c521595-4e12-46b0-8248-b8f2d3697766";

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

@Autowired
Expand Down Expand Up @@ -60,4 +64,14 @@ public void getRelationshipWithWrongUuid_shouldReturnNull() {
assertThat(relationship, nullValue());
}

@Test
public void getRelationshipWithUuid_shouldReturnPersonAAndPersonB() {
Relationship relationship = relatedPersonDao.get(RELATIONSHIP_UUID);
assertThat(relationship, notNullValue());
assertThat(relationship.getPersonA(), notNullValue());
assertThat(relationship.getPersonB(), notNullValue());
assertThat(relationship.getPersonA().getUuid(), equalTo(PERSON_A_UUID));
assertThat(relationship.getPersonB().getUuid(), equalTo(PERSON_B_UUID));
}

}

0 comments on commit cb69c3e

Please sign in to comment.