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,17 +330,19 @@
<baseResourceName>test</baseResourceName>
-->
<baseResourceName>testscript</baseResourceName>
<baseResourceName>user</baseResourceName>
<baseResourceName>valueset</baseResourceName>
<baseResourceName>visionprescription</baseResourceName>
</baseResourceNames>
<package>ca.uhn.fhir.model.dstu2</package>
<version>dstu2</version>
<buildDatatypes>true</buildDatatypes>
</configuration>
</execution>
<!-- <execution> <id>clean_source</id> <goals> <goal>minimize-resources</goal> </goals> <configuration> <fhirVersion>DSTU2</fhirVersion> <targetDirectory>${project.baseDir}/../hapi-tinder-plugin/</targetDirectory>
</configuration> </execution> -->
<!-- Removed in HAPI 3.4.0 as this isn't a real resource
<baseResourceName>user</baseResourceName>
-->
<baseResourceName>valueset</baseResourceName>
<baseResourceName>visionprescription</baseResourceName>
</baseResourceNames>
<package>ca.uhn.fhir.model.dstu2</package>
<version>dstu2</version>
<buildDatatypes>true</buildDatatypes>
</configuration>
</execution>
<!-- <execution> <id>clean_source</id> <goals> <goal>minimize-resources</goal> </goals> <configuration> <fhirVersion>DSTU2</fhirVersion> <targetDirectory>${project.baseDir}/../hapi-tinder-plugin/</targetDirectory>
</configuration> </execution> -->
</executions>
</plugin>
<plugin>

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,6 +98,24 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IValid
return myBestPracticeWarningLevel;
}
/**
* Sets the "best practice warning level". When validating, any deviations from best practices will be reported at
* this level.
* <p>
* The FHIR Instance Validator has a number of checks for best practices in terms of FHIR usage. If this setting is
* set to {@link BestPracticeWarningLevel#Error}, any resource data which does not meet these best practices will be
* reported at the ERROR level. If this setting is set to {@link BestPracticeWarningLevel#Ignore}, best practice
* guielines will be ignored.
* </p>
*
* @param theBestPracticeWarningLevel
* The level, must not be <code>null</code>
*/
public void setBestPracticeWarningLevel(BestPracticeWarningLevel theBestPracticeWarningLevel) {
Validate.notNull(theBestPracticeWarningLevel);
myBestPracticeWarningLevel = theBestPracticeWarningLevel;
}
/**
* 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.
@ -106,6 +124,14 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IValid
return myValidationSupport;
}
/**
* Sets 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 setValidationSupport(IValidationSupport 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
@ -115,13 +141,6 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IValid
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
@ -132,21 +151,10 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IValid
}
/**
* Sets the "best practice warning level". When validating, any deviations from best practices will be reported at
* this level.
* <p>
* The FHIR Instance Validator has a number of checks for best practices in terms of FHIR usage. If this setting is
* set to {@link BestPracticeWarningLevel#Error}, any resource data which does not meet these best practices will be
* reported at the ERROR level. If this setting is set to {@link BestPracticeWarningLevel#Ignore}, best practice
* guielines will be ignored.
* </p>
*
* @param theBestPracticeWarningLevel
* The level, must not be <code>null</code>
* If set to {@literal true} (default is false) the valueSet will not be validate
*/
public void setBestPracticeWarningLevel(BestPracticeWarningLevel theBestPracticeWarningLevel) {
Validate.notNull(theBestPracticeWarningLevel);
myBestPracticeWarningLevel = theBestPracticeWarningLevel;
public boolean isNoTerminologyChecks() {
return myNoTerminologyChecks;
}
/**
@ -160,14 +168,6 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IValid
myStructureDefintion = theStructureDefintion;
}
/**
* Sets 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 setValidationSupport(IValidationSupport theValidationSupport) {
myValidationSupport = theValidationSupport;
}
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);
}
}