From 6a5b96d05f03e91f8a61cf9575b3e6293ef0f401 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Thu, 23 Jul 2020 15:52:12 -0700 Subject: [PATCH] Start with broken test for #1996 --- .../src/test/resources/empi/empi-rules.json | 13 +------------ .../empi/rules/config/EmpiRuleValidatorTest.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/hapi-fhir-jpaserver-empi/src/test/resources/empi/empi-rules.json b/hapi-fhir-jpaserver-empi/src/test/resources/empi/empi-rules.json index 24d8fcb0b5e..9231853fa61 100644 --- a/hapi-fhir-jpaserver-empi/src/test/resources/empi/empi-rules.json +++ b/hapi-fhir-jpaserver-empi/src/test/resources/empi/empi-rules.json @@ -1,18 +1,7 @@ { "version": "1", "candidateSearchParams": [ - { - "resourceType": "Patient", - "searchParams": ["birthdate"] - }, - { - "resourceType": "*", - "searchParams": ["identifier"] - }, - { - "resourceType": "Patient", - "searchParams": ["general-practitioner"] - } + ], "candidateFilterSearchParams": [ { diff --git a/hapi-fhir-server-empi/src/test/java/ca/uhn/fhir/empi/rules/config/EmpiRuleValidatorTest.java b/hapi-fhir-server-empi/src/test/java/ca/uhn/fhir/empi/rules/config/EmpiRuleValidatorTest.java index b2766a6f70b..e9fe675c3f2 100644 --- a/hapi-fhir-server-empi/src/test/java/ca/uhn/fhir/empi/rules/config/EmpiRuleValidatorTest.java +++ b/hapi-fhir-server-empi/src/test/java/ca/uhn/fhir/empi/rules/config/EmpiRuleValidatorTest.java @@ -76,6 +76,16 @@ public class EmpiRuleValidatorTest extends BaseR4Test { } } + @Test + public void testMatcherEmptyCandidateSearchParams() throws IOException { + try { + setEmpiRuleJson("bad-rules-missing-candidate-search-params.json"); + fail(); + } catch (ConfigurationException e) { + assertThat(e.getMessage(), startsWith("Error in candidateSearchParams: Patient does not have a search parameter called 'foo'")); + } + } + @Test public void testMatcherBadFilter() throws IOException { try {