remove id from terminology service tests

This commit is contained in:
Grahame Grieve 2023-04-21 12:26:28 +08:00
parent 580079f26d
commit 5a4d7f4831
4 changed files with 30 additions and 5 deletions

View File

@ -227,12 +227,12 @@ public class TxTester {
String vsj;
try {
ValueSet vs = tx.expandValueset(null, p, null);
vs.setText(null);
TxTesterScrubbers.scrub(vs);
TxTesterSorters.sortValueSet(vs);
vsj = new org.hl7.fhir.r5.formats.JsonParser().setOutputStyle(OutputStyle.PRETTY).composeString(vs);
} catch (EFhirClientException e) {
OperationOutcome oo = e.getServerErrors().get(0);
oo.setText(null);
TxTesterScrubbers.scrub(oo);
vsj = new org.hl7.fhir.r5.formats.JsonParser().setOutputStyle(OutputStyle.PRETTY).composeString(oo);
}
String diff = CompareUtilities.checkJsonSrcIsSame(resp, vsj);
@ -250,6 +250,7 @@ public class TxTester {
String pj;
try {
Parameters po = tx.validateVS(p);
TxTesterScrubbers.scrub(po);
TxTesterSorters.sortParameters(po);
pj = new org.hl7.fhir.r5.formats.JsonParser().setOutputStyle(OutputStyle.PRETTY).composeString(po);
} catch (EFhirClientException e) {

View File

@ -0,0 +1,20 @@
package org.hl7.fhir.validation.special;
import org.hl7.fhir.r5.model.DomainResource;
import org.hl7.fhir.r5.model.Parameters;
import org.hl7.fhir.r5.model.ValueSet;
public class TxTesterScrubbers {
public static void scrub(DomainResource dr) {
dr.setText(null);
dr.setMeta(null);
}
public static void scrub(Parameters po) {
po.setMeta(null);
}
}

View File

@ -47,8 +47,8 @@ public class ExternalTerminologyServiceTests implements ITxTesterLoader {
private JsonObject test;
}
private static final String SERVER = Servers.TX_SERVER_DEV;
// private static final String SERVER = Servers.TX_SERVER_LOCAL;
// private static final String SERVER = Servers.TX_SERVER_DEV;
private static final String SERVER = Servers.TX_SERVER_LOCAL;
@Parameters(name = "{index}: id {0}")
public static Iterable<Object[]> data() throws IOException {

View File

@ -44,6 +44,7 @@ import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.json.model.JsonObject;
import org.hl7.fhir.utilities.validation.ValidationOptions;
import org.hl7.fhir.validation.ValidationEngine;
import org.hl7.fhir.validation.special.TxTesterScrubbers;
import org.hl7.fhir.validation.special.TxTesterSorters;
import org.hl7.fhir.validation.tests.ValidationEngineTests;
import org.hl7.fhir.validation.tests.utilities.TestUtilities;
@ -154,6 +155,7 @@ public class TerminologyServiceTests {
removeParameter(vse.getValueset(), "excludeNested");
}
TxTesterSorters.sortValueSet(vse.getValueset());
TxTesterScrubbers.scrub(vse.getValueset());
String vsj = new JsonParser().setOutputStyle(OutputStyle.PRETTY).composeString(vse.getValueset());
String diff = CompareUtilities.checkJsonSrcIsSame(resp, vsj);
if (diff != null) {
@ -197,6 +199,7 @@ public class TerminologyServiceTests {
}
e.getDetails().setText(vse.getError());
oo.addIssue(e);
TxTesterScrubbers.scrub(oo);
String ooj = new JsonParser().setOutputStyle(OutputStyle.PRETTY).composeString(oo);
String diff = CompareUtilities.checkJsonSrcIsSame(resp, ooj);
@ -263,7 +266,8 @@ public class TerminologyServiceTests {
res.addParameter().setName("issues").setResource(oo);
}
TxTesterSorters.sortParameters(res);
TxTesterScrubbers.scrub(res);
String pj = new JsonParser().setOutputStyle(OutputStyle.PRETTY).composeString(res);
String diff = CompareUtilities.checkJsonSrcIsSame(resp, pj);
if (diff != null) {