FIx test issues

This commit is contained in:
jamesagnew 2018-05-21 13:07:11 -04:00
parent a2a81f9878
commit e8139192e0
8 changed files with 71 additions and 12965 deletions

View File

@ -108,6 +108,29 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
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
public void beforeDisableResultReuse() {
myDaoConfig.setReuseCachedSearchResultsForMillis(null);

View File

@ -105,7 +105,7 @@ where res_id in (
where ((res.res_ver + 1) = (rv.res_ver))
)
# Oracle
drop table hfj_history_tag cascade constraints;
drop table hfj_forced_id cascade constraints;
drop table hfj_res_link cascade constraints;

View File

@ -87,8 +87,8 @@ public class FhirTesterConfig {
.addServer()
.withId("spark2")
.withFhirVersion(FhirVersionEnum.DSTU3)
.withBaseUrl("http://vonk.furore.com/")
.withName("Vonk - Furore (STU3 FHIR)");
.withBaseUrl("http://vonk.fire.ly/")
.withName("Vonk - Firely (STU3 FHIR)");
return retVal;
}

View File

@ -330,7 +330,9 @@
<baseResourceName>test</baseResourceName>
-->
<baseResourceName>testscript</baseResourceName>
<!-- Removed in HAPI 3.4.0 as this isn't a real resource
<baseResourceName>user</baseResourceName>
-->
<baseResourceName>valueset</baseResourceName>
<baseResourceName>visionprescription</baseResourceName>
</baseResourceNames>

View File

@ -229,6 +229,7 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IValid
try {
v.validate(null, messages, document, profile.getUrl());
} catch (Exception e) {
ourLog.error("Failure during validation", e);
throw new InternalErrorException("Unexpected failure while validating resource", e);
}
}

View File

@ -263,6 +263,7 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IValid
try {
v.validate(null, messages, document, profile.getUrl());
} catch (Exception e) {
ourLog.error("Failure during validation", e);
throw new InternalErrorException("Unexpected failure while validating resource", e);
}
}

View File

@ -98,39 +98,6 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IValid
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
* 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) {
myNoTerminologyChecks = theNoTerminologyChecks;
}
public void setStructureDefintion(StructureDefinition theStructureDefintion) {
myStructureDefintion = theStructureDefintion;
public IValidationSupport getValidationSupport() {
return myValidationSupport;
}
/**
@ -168,6 +132,42 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IValid
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) {
HapiWorkerContext workerContext = new HapiWorkerContext(theCtx, myValidationSupport);
@ -219,6 +219,7 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IValid
try {
v.validate(null, messages, json, profile);
} catch (Exception e) {
ourLog.error("Failure during validation", e);
throw new InternalErrorException("Unexpected failure while validating resource", e);
}
}