Add test for invalid local reference (R4)
Currently an invalid local reference causes an InternalErrorException caused by: FHIRException: Resource resolution services not provided. The validation should instead return normally and contain an error message.
This commit is contained in:
parent
229e0977d2
commit
f2cd05fe3b
|
@ -68,6 +68,21 @@ public class FhirInstanceValidatorR4Test {
|
||||||
myValidConcepts.add(theSystem + "___" + theCode);
|
myValidConcepts.add(theSystem + "___" + theCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An invalid local reference should not cause a ServiceException.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testInvalidLocalReference() {
|
||||||
|
QuestionnaireResponse resource = new QuestionnaireResponse();
|
||||||
|
resource.setStatus(QuestionnaireResponse.QuestionnaireResponseStatus.COMPLETED);
|
||||||
|
|
||||||
|
resource.setSubject(new Reference("#invalid-ref"));
|
||||||
|
|
||||||
|
ValidationResult output = myVal.validateWithResult(resource);
|
||||||
|
List<SingleValidationMessage> nonInfo = logResultsAndReturnNonInformationalOnes(output);
|
||||||
|
assertThat(nonInfo, hasSize(2));
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Before
|
@Before
|
||||||
public void before() {
|
public void before() {
|
||||||
|
|
Loading…
Reference in New Issue