Disable user resource and weaken validation on the public server

This commit is contained in:
jamesagnew 2018-05-21 19:04:37 -04:00
parent e8139192e0
commit 7e83fc78cf
3 changed files with 27 additions and 5 deletions

View File

@ -132,7 +132,7 @@ public class TestDstu3Config extends BaseJavaConfigDstu3 {
requestValidator.setFailOnSeverity(null);
requestValidator.setAddResponseHeaderOnSeverity(null);
requestValidator.setAddResponseOutcomeHeaderOnSeverity(ResultSeverityEnum.INFORMATION);
requestValidator.addValidatorModule(instanceValidatorDstu3());
// requestValidator.addValidatorModule(instanceValidatorDstu3());
requestValidator.setIgnoreValidatorExceptions(true);
return requestValidator;

View File

@ -4,6 +4,7 @@ import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.dstu2.composite.PeriodDt;
import ca.uhn.fhir.model.dstu2.valueset.ProcedureStatusEnum;
import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.util.StopWatch;
import ca.uhn.fhir.util.TestUtil;
import ca.uhn.fhir.validation.FhirValidator;
import ca.uhn.fhir.validation.ResultSeverityEnum;
@ -30,6 +31,8 @@ import org.junit.runner.Description;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
@ -67,9 +70,29 @@ public class FhirInstanceValidatorDstu3Test {
myValidConcepts.add(theSystem + "___" + theCode);
}
/**
* See #873
*/
@Test
public void testStress() throws IOException {
String input = IOUtils.toString(new FileReader("/home/james/Downloads/history.json"));
FhirValidator val = ourCtx.newValidator();
val.registerValidatorModule(new FhirInstanceValidator(myDefaultValidationSupport));
val.validateWithResult(input);
StopWatch sw = new StopWatch();
int loops = 100;
for (int i = 0; i < loops; i++) {
val.validateWithResult(input);
}
ourLog.info("Validated {} times AVG {}ms/val", loops, sw.getMillisPerOperation(loops));
}
/**
* See #873
*/
@Test
public void testCompareTimesWithDifferentTimezones() {
Procedure procedure = new Procedure();

View File

@ -92,7 +92,6 @@ resource.Substance=ca.uhn.fhir.model.dstu2.resource.Substance
resource.SupplyDelivery=ca.uhn.fhir.model.dstu2.resource.SupplyDelivery
resource.SupplyRequest=ca.uhn.fhir.model.dstu2.resource.SupplyRequest
resource.TestScript=ca.uhn.fhir.model.dstu2.resource.TestScript
resource.User=ca.uhn.fhir.model.dstu2.resource.User
resource.ValueSet=ca.uhn.fhir.model.dstu2.resource.ValueSet
resource.VisionPrescription=ca.uhn.fhir.model.dstu2.resource.VisionPrescription