FIx test issues
This commit is contained in:
parent
a2a81f9878
commit
e8139192e0
|
@ -108,6 +108,29 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
|
||||||
myClient.registerInterceptor(myCapturingInterceptor);
|
myClient.registerInterceptor(myCapturingInterceptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDeleteConditional() {
|
||||||
|
|
||||||
|
Patient p = new Patient();
|
||||||
|
p.addName().setFamily("FAM").addGiven("GIV");
|
||||||
|
IIdType id = myPatientDao.create(p).getId();
|
||||||
|
|
||||||
|
myClient.read().resource("Patient").withId(id.toUnqualifiedVersionless()).execute();
|
||||||
|
|
||||||
|
myClient
|
||||||
|
.delete()
|
||||||
|
.resourceConditionalByUrl("Patient?family=FAM&given=giv")
|
||||||
|
.execute();
|
||||||
|
|
||||||
|
try {
|
||||||
|
myClient.read().resource("Patient").withId(id.toUnqualifiedVersionless()).execute();
|
||||||
|
fail();
|
||||||
|
} catch (ResourceGoneException e) {
|
||||||
|
// good
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void beforeDisableResultReuse() {
|
public void beforeDisableResultReuse() {
|
||||||
myDaoConfig.setReuseCachedSearchResultsForMillis(null);
|
myDaoConfig.setReuseCachedSearchResultsForMillis(null);
|
||||||
|
|
|
@ -105,7 +105,7 @@ where res_id in (
|
||||||
where ((res.res_ver + 1) = (rv.res_ver))
|
where ((res.res_ver + 1) = (rv.res_ver))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Oracle
|
||||||
drop table hfj_history_tag cascade constraints;
|
drop table hfj_history_tag cascade constraints;
|
||||||
drop table hfj_forced_id cascade constraints;
|
drop table hfj_forced_id cascade constraints;
|
||||||
drop table hfj_res_link cascade constraints;
|
drop table hfj_res_link cascade constraints;
|
||||||
|
|
|
@ -87,8 +87,8 @@ public class FhirTesterConfig {
|
||||||
.addServer()
|
.addServer()
|
||||||
.withId("spark2")
|
.withId("spark2")
|
||||||
.withFhirVersion(FhirVersionEnum.DSTU3)
|
.withFhirVersion(FhirVersionEnum.DSTU3)
|
||||||
.withBaseUrl("http://vonk.furore.com/")
|
.withBaseUrl("http://vonk.fire.ly/")
|
||||||
.withName("Vonk - Furore (STU3 FHIR)");
|
.withName("Vonk - Firely (STU3 FHIR)");
|
||||||
|
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
|
@ -330,7 +330,9 @@
|
||||||
<baseResourceName>test</baseResourceName>
|
<baseResourceName>test</baseResourceName>
|
||||||
-->
|
-->
|
||||||
<baseResourceName>testscript</baseResourceName>
|
<baseResourceName>testscript</baseResourceName>
|
||||||
|
<!-- Removed in HAPI 3.4.0 as this isn't a real resource
|
||||||
<baseResourceName>user</baseResourceName>
|
<baseResourceName>user</baseResourceName>
|
||||||
|
-->
|
||||||
<baseResourceName>valueset</baseResourceName>
|
<baseResourceName>valueset</baseResourceName>
|
||||||
<baseResourceName>visionprescription</baseResourceName>
|
<baseResourceName>visionprescription</baseResourceName>
|
||||||
</baseResourceNames>
|
</baseResourceNames>
|
||||||
|
|
|
@ -229,6 +229,7 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IValid
|
||||||
try {
|
try {
|
||||||
v.validate(null, messages, document, profile.getUrl());
|
v.validate(null, messages, document, profile.getUrl());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
ourLog.error("Failure during validation", e);
|
||||||
throw new InternalErrorException("Unexpected failure while validating resource", e);
|
throw new InternalErrorException("Unexpected failure while validating resource", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -263,6 +263,7 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IValid
|
||||||
try {
|
try {
|
||||||
v.validate(null, messages, document, profile.getUrl());
|
v.validate(null, messages, document, profile.getUrl());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
ourLog.error("Failure during validation", e);
|
||||||
throw new InternalErrorException("Unexpected failure while validating resource", e);
|
throw new InternalErrorException("Unexpected failure while validating resource", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,39 +98,6 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IValid
|
||||||
return myBestPracticeWarningLevel;
|
return myBestPracticeWarningLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the {@link IValidationSupport validation support} in use by this validator. Default is an instance of
|
|
||||||
* {@link DefaultProfileValidationSupport} if the no-arguments constructor for this object was used.
|
|
||||||
*/
|
|
||||||
public IValidationSupport getValidationSupport() {
|
|
||||||
return myValidationSupport;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If set to {@literal true} (default is true) extensions which are not known to the
|
|
||||||
* validator (e.g. because they have not been explicitly declared in a profile) will
|
|
||||||
* be validated but will not cause an error.
|
|
||||||
*/
|
|
||||||
public boolean isAnyExtensionsAllowed() {
|
|
||||||
return myAnyExtensionsAllowed;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If set to {@literal true} (default is false) the valueSet will not be validate
|
|
||||||
*/
|
|
||||||
public boolean isNoTerminologyChecks() {
|
|
||||||
return myNoTerminologyChecks;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If set to {@literal true} (default is true) extensions which are not known to the
|
|
||||||
* validator (e.g. because they have not been explicitly declared in a profile) will
|
|
||||||
* be validated but will not cause an error.
|
|
||||||
*/
|
|
||||||
public void setAnyExtensionsAllowed(boolean theAnyExtensionsAllowed) {
|
|
||||||
myAnyExtensionsAllowed = theAnyExtensionsAllowed;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the "best practice warning level". When validating, any deviations from best practices will be reported at
|
* Sets the "best practice warning level". When validating, any deviations from best practices will be reported at
|
||||||
* this level.
|
* this level.
|
||||||
|
@ -150,14 +117,11 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IValid
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If set to {@literal true} (default is false) the valueSet will not be validate
|
* Returns the {@link IValidationSupport validation support} in use by this validator. Default is an instance of
|
||||||
|
* {@link DefaultProfileValidationSupport} if the no-arguments constructor for this object was used.
|
||||||
*/
|
*/
|
||||||
public void setNoTerminologyChecks(final boolean theNoTerminologyChecks) {
|
public IValidationSupport getValidationSupport() {
|
||||||
myNoTerminologyChecks = theNoTerminologyChecks;
|
return myValidationSupport;
|
||||||
}
|
|
||||||
|
|
||||||
public void setStructureDefintion(StructureDefinition theStructureDefintion) {
|
|
||||||
myStructureDefintion = theStructureDefintion;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -168,6 +132,42 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IValid
|
||||||
myValidationSupport = theValidationSupport;
|
myValidationSupport = theValidationSupport;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If set to {@literal true} (default is true) extensions which are not known to the
|
||||||
|
* validator (e.g. because they have not been explicitly declared in a profile) will
|
||||||
|
* be validated but will not cause an error.
|
||||||
|
*/
|
||||||
|
public boolean isAnyExtensionsAllowed() {
|
||||||
|
return myAnyExtensionsAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If set to {@literal true} (default is true) extensions which are not known to the
|
||||||
|
* validator (e.g. because they have not been explicitly declared in a profile) will
|
||||||
|
* be validated but will not cause an error.
|
||||||
|
*/
|
||||||
|
public void setAnyExtensionsAllowed(boolean theAnyExtensionsAllowed) {
|
||||||
|
myAnyExtensionsAllowed = theAnyExtensionsAllowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If set to {@literal true} (default is false) the valueSet will not be validate
|
||||||
|
*/
|
||||||
|
public boolean isNoTerminologyChecks() {
|
||||||
|
return myNoTerminologyChecks;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If set to {@literal true} (default is false) the valueSet will not be validate
|
||||||
|
*/
|
||||||
|
public void setNoTerminologyChecks(final boolean theNoTerminologyChecks) {
|
||||||
|
myNoTerminologyChecks = theNoTerminologyChecks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStructureDefintion(StructureDefinition theStructureDefintion) {
|
||||||
|
myStructureDefintion = theStructureDefintion;
|
||||||
|
}
|
||||||
|
|
||||||
protected List<ValidationMessage> validate(final FhirContext theCtx, String theInput, EncodingEnum theEncoding) {
|
protected List<ValidationMessage> validate(final FhirContext theCtx, String theInput, EncodingEnum theEncoding) {
|
||||||
HapiWorkerContext workerContext = new HapiWorkerContext(theCtx, myValidationSupport);
|
HapiWorkerContext workerContext = new HapiWorkerContext(theCtx, myValidationSupport);
|
||||||
|
|
||||||
|
@ -219,6 +219,7 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IValid
|
||||||
try {
|
try {
|
||||||
v.validate(null, messages, json, profile);
|
v.validate(null, messages, json, profile);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
ourLog.error("Failure during validation", e);
|
||||||
throw new InternalErrorException("Unexpected failure while validating resource", e);
|
throw new InternalErrorException("Unexpected failure while validating resource", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue