mirror of
https://github.com/hapifhir/hapi-fhir.git
synced 2025-02-16 18:05:19 +00:00
Added asserts
This commit is contained in:
parent
c63a503841
commit
010628fa86
@ -80,7 +80,19 @@ public class MdmEventIT extends BaseMdmR4Test {
|
|||||||
MdmLinkEvent linkChangeEvent = myMdmHelper.getAfterMdmLatch().getLatchInvocationParameterOfType(MdmLinkEvent.class);
|
MdmLinkEvent linkChangeEvent = myMdmHelper.getAfterMdmLatch().getLatchInvocationParameterOfType(MdmLinkEvent.class);
|
||||||
assertNotNull(linkChangeEvent);
|
assertNotNull(linkChangeEvent);
|
||||||
|
|
||||||
// MdmTransactionContext ctx = myMdmMatchLinkSvc.updateMdmLinksForMdmSource(patient2, createContextForUpdate(patient2.getIdElement().getResourceType()));
|
ourLog.info("Got event: {}", linkChangeEvent);
|
||||||
|
|
||||||
|
long expectTwoPossibleMatchesForPatientTwo = linkChangeEvent.getMdmLinks()
|
||||||
|
.stream()
|
||||||
|
.filter(l -> l.getSourceId().equals(patient2.getIdElement().toVersionless().getValueAsString()) && l.getMatchResult() == MdmMatchResultEnum.POSSIBLE_MATCH)
|
||||||
|
.count();
|
||||||
|
assertEquals(2, expectTwoPossibleMatchesForPatientTwo);
|
||||||
|
|
||||||
|
long expectOnePossibleDuplicate = linkChangeEvent.getMdmLinks()
|
||||||
|
.stream()
|
||||||
|
.filter(l -> l.getMatchResult() == MdmMatchResultEnum.POSSIBLE_DUPLICATE)
|
||||||
|
.count();
|
||||||
|
assertEquals(1, expectOnePossibleDuplicate);
|
||||||
|
|
||||||
List<MdmLinkJson> mdmLinkEvent = linkChangeEvent.getMdmLinks();
|
List<MdmLinkJson> mdmLinkEvent = linkChangeEvent.getMdmLinks();
|
||||||
assertEquals(3, mdmLinkEvent.size());
|
assertEquals(3, mdmLinkEvent.size());
|
||||||
@ -122,10 +134,9 @@ public class MdmEventIT extends BaseMdmR4Test {
|
|||||||
assertEquals(1, linkChangeEvent.getMdmLinks().size());
|
assertEquals(1, linkChangeEvent.getMdmLinks().size());
|
||||||
|
|
||||||
MdmLinkJson link = linkChangeEvent.getMdmLinks().get(0);
|
MdmLinkJson link = linkChangeEvent.getMdmLinks().get(0);
|
||||||
assertEquals(patient1.getResourceType() + "/" + patient1.getIdElement().getIdPart(), link.getSourceId());
|
assertEquals(patient1.getIdElement().toVersionless().getValueAsString(), link.getSourceId());
|
||||||
assertEquals(getLinkByTargetId(patient1).getGoldenResourcePid(), new IdDt(link.getGoldenResourceId()).getIdPartAsLong());
|
assertEquals(getLinkByTargetId(patient1).getGoldenResourcePid(), new IdDt(link.getGoldenResourceId()).getIdPartAsLong());
|
||||||
assertEquals(MdmMatchResultEnum.MATCH, link.getMatchResult());
|
assertEquals(MdmMatchResultEnum.MATCH, link.getMatchResult());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -175,4 +175,22 @@ public class MdmLinkJson implements IModelJson {
|
|||||||
public void setRuleCount(Long theRuleCount) {
|
public void setRuleCount(Long theRuleCount) {
|
||||||
myRuleCount = theRuleCount;
|
myRuleCount = theRuleCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "MdmLinkJson{" +
|
||||||
|
"myGoldenResourceId='" + myGoldenResourceId + '\'' +
|
||||||
|
", mySourceId='" + mySourceId + '\'' +
|
||||||
|
", myMatchResult=" + myMatchResult +
|
||||||
|
", myLinkSource=" + myLinkSource +
|
||||||
|
", myCreated=" + myCreated +
|
||||||
|
", myUpdated=" + myUpdated +
|
||||||
|
", myVersion='" + myVersion + '\'' +
|
||||||
|
", myEidMatch=" + myEidMatch +
|
||||||
|
", myLinkCreatedNewResource=" + myLinkCreatedNewResource +
|
||||||
|
", myVector=" + myVector +
|
||||||
|
", myScore=" + myScore +
|
||||||
|
", myRuleCount=" + myRuleCount +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user