Update syntax highlighter to not use tables
This commit is contained in:
parent
ff8b5607f3
commit
cae21f4898
|
@ -193,8 +193,14 @@ public class Include implements Serializable {
|
||||||
return myRecurse;
|
return myRecurse;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRecurse(boolean theRecurse) {
|
/**
|
||||||
|
* Should this include recurse
|
||||||
|
*
|
||||||
|
* @return Returns a reference to <code>this</code> for easy method chaining
|
||||||
|
*/
|
||||||
|
public Include setRecurse(boolean theRecurse) {
|
||||||
myRecurse = theRecurse;
|
myRecurse = theRecurse;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setValue(String theValue) {
|
public void setValue(String theValue) {
|
||||||
|
|
|
@ -439,7 +439,12 @@ public class FhirSystemDaoDstu3 extends BaseHapiFhirSystemDao<Bundle, Meta> {
|
||||||
outcome = resourceDao.update(res, null, false, theRequestDetails);
|
outcome = resourceDao.update(res, null, false, theRequestDetails);
|
||||||
} else {
|
} else {
|
||||||
res.setId((String) null);
|
res.setId((String) null);
|
||||||
String matchUrl = parts.getResourceType() + '?' + parts.getParams();
|
String matchUrl;
|
||||||
|
if (isNotBlank(parts.getParams())) {
|
||||||
|
matchUrl = parts.getResourceType() + '?' + parts.getParams();
|
||||||
|
} else {
|
||||||
|
matchUrl = parts.getResourceType();
|
||||||
|
}
|
||||||
matchUrl = performIdSubstitutionsInMatchUrl(idSubstitutions, matchUrl);
|
matchUrl = performIdSubstitutionsInMatchUrl(idSubstitutions, matchUrl);
|
||||||
outcome = resourceDao.update(res, matchUrl, false, theRequestDetails);
|
outcome = resourceDao.update(res, matchUrl, false, theRequestDetails);
|
||||||
if (Boolean.TRUE.equals(outcome.getCreated())) {
|
if (Boolean.TRUE.equals(outcome.getCreated())) {
|
||||||
|
|
|
@ -439,7 +439,12 @@ public class FhirSystemDaoR4 extends BaseHapiFhirSystemDao<Bundle, Meta> {
|
||||||
outcome = resourceDao.update(res, null, false, theRequestDetails);
|
outcome = resourceDao.update(res, null, false, theRequestDetails);
|
||||||
} else {
|
} else {
|
||||||
res.setId((String) null);
|
res.setId((String) null);
|
||||||
String matchUrl = parts.getResourceType() + '?' + parts.getParams();
|
String matchUrl;
|
||||||
|
if (isNotBlank(parts.getParams())) {
|
||||||
|
matchUrl = parts.getResourceType() + '?' + parts.getParams();
|
||||||
|
} else {
|
||||||
|
matchUrl = parts.getResourceType();
|
||||||
|
}
|
||||||
matchUrl = performIdSubstitutionsInMatchUrl(idSubstitutions, matchUrl);
|
matchUrl = performIdSubstitutionsInMatchUrl(idSubstitutions, matchUrl);
|
||||||
outcome = resourceDao.update(res, matchUrl, false, theRequestDetails);
|
outcome = resourceDao.update(res, matchUrl, false, theRequestDetails);
|
||||||
if (Boolean.TRUE.equals(outcome.getCreated())) {
|
if (Boolean.TRUE.equals(outcome.getCreated())) {
|
||||||
|
|
|
@ -1,38 +1,12 @@
|
||||||
package ca.uhn.fhir.jpa.dao.dstu3;
|
package ca.uhn.fhir.jpa.dao.dstu3;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.*;
|
import ca.uhn.fhir.jpa.dao.BaseHapiFhirDao;
|
||||||
import static org.junit.Assert.*;
|
import ca.uhn.fhir.jpa.dao.DaoConfig;
|
||||||
import static org.mockito.Matchers.eq;
|
import ca.uhn.fhir.jpa.dao.SearchParameterMap;
|
||||||
import static org.mockito.Mockito.times;
|
import ca.uhn.fhir.jpa.entity.ResourceEncodingEnum;
|
||||||
import static org.mockito.Mockito.verify;
|
import ca.uhn.fhir.jpa.entity.ResourceTable;
|
||||||
|
import ca.uhn.fhir.jpa.entity.ResourceTag;
|
||||||
import java.io.*;
|
import ca.uhn.fhir.jpa.entity.TagTypeEnum;
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
|
||||||
import org.hl7.fhir.dstu3.model.*;
|
|
||||||
import org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent;
|
|
||||||
import org.hl7.fhir.dstu3.model.Bundle.BundleEntryRequestComponent;
|
|
||||||
import org.hl7.fhir.dstu3.model.Bundle.BundleEntryResponseComponent;
|
|
||||||
import org.hl7.fhir.dstu3.model.Bundle.BundleType;
|
|
||||||
import org.hl7.fhir.dstu3.model.Bundle.HTTPVerb;
|
|
||||||
import org.hl7.fhir.dstu3.model.Observation.ObservationStatus;
|
|
||||||
import org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity;
|
|
||||||
import org.hl7.fhir.instance.model.api.IAnyResource;
|
|
||||||
import org.hl7.fhir.instance.model.api.IIdType;
|
|
||||||
import org.junit.*;
|
|
||||||
import org.mockito.ArgumentCaptor;
|
|
||||||
import org.springframework.transaction.TransactionDefinition;
|
|
||||||
import org.springframework.transaction.TransactionStatus;
|
|
||||||
import org.springframework.transaction.support.*;
|
|
||||||
|
|
||||||
import ca.uhn.fhir.jpa.dao.*;
|
|
||||||
import ca.uhn.fhir.jpa.entity.*;
|
|
||||||
import ca.uhn.fhir.jpa.provider.SystemProviderDstu2Test;
|
import ca.uhn.fhir.jpa.provider.SystemProviderDstu2Test;
|
||||||
import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum;
|
import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum;
|
||||||
import ca.uhn.fhir.model.primitive.IdDt;
|
import ca.uhn.fhir.model.primitive.IdDt;
|
||||||
|
@ -43,6 +17,35 @@ import ca.uhn.fhir.rest.param.ReferenceParam;
|
||||||
import ca.uhn.fhir.rest.server.exceptions.*;
|
import ca.uhn.fhir.rest.server.exceptions.*;
|
||||||
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.ActionRequestDetails;
|
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.ActionRequestDetails;
|
||||||
import ca.uhn.fhir.util.TestUtil;
|
import ca.uhn.fhir.util.TestUtil;
|
||||||
|
import org.apache.commons.io.IOUtils;
|
||||||
|
import org.hl7.fhir.dstu3.model.*;
|
||||||
|
import org.hl7.fhir.dstu3.model.Bundle.*;
|
||||||
|
import org.hl7.fhir.dstu3.model.Observation.ObservationStatus;
|
||||||
|
import org.hl7.fhir.dstu3.model.OperationOutcome.IssueSeverity;
|
||||||
|
import org.hl7.fhir.instance.model.api.IAnyResource;
|
||||||
|
import org.hl7.fhir.instance.model.api.IIdType;
|
||||||
|
import org.junit.*;
|
||||||
|
import org.mockito.ArgumentCaptor;
|
||||||
|
import org.springframework.transaction.TransactionDefinition;
|
||||||
|
import org.springframework.transaction.TransactionStatus;
|
||||||
|
import org.springframework.transaction.support.TransactionCallback;
|
||||||
|
import org.springframework.transaction.support.TransactionCallbackWithoutResult;
|
||||||
|
import org.springframework.transaction.support.TransactionTemplate;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import static org.hamcrest.Matchers.*;
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
import static org.mockito.Matchers.eq;
|
||||||
|
import static org.mockito.Mockito.times;
|
||||||
|
import static org.mockito.Mockito.verify;
|
||||||
|
|
||||||
public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest {
|
public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest {
|
||||||
|
|
||||||
|
@ -1086,7 +1089,6 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTransactionCreateWithInvalidReferenceNumeric() {
|
public void testTransactionCreateWithInvalidReferenceNumeric() {
|
||||||
String methodName = "testTransactionCreateWithInvalidReferenceNumeric";
|
String methodName = "testTransactionCreateWithInvalidReferenceNumeric";
|
||||||
|
@ -1125,6 +1127,27 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testTransactionCreateWithLinks() throws IOException {
|
||||||
|
Bundle request = new Bundle();
|
||||||
|
request.setType(BundleType.TRANSACTION);
|
||||||
|
|
||||||
|
Observation o = new Observation();
|
||||||
|
o.setId("A");
|
||||||
|
o.setStatus(ObservationStatus.AMENDED);
|
||||||
|
|
||||||
|
request.addEntry()
|
||||||
|
.setResource(o)
|
||||||
|
.getRequest().setUrl("A").setMethod(HTTPVerb.PUT);
|
||||||
|
|
||||||
|
try {
|
||||||
|
mySystemDao.transaction(mySrd, request);
|
||||||
|
fail();
|
||||||
|
} catch (InvalidRequestException e) {
|
||||||
|
assertEquals("Invalid match URL[A] - URL has no search parameters", e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTransactionCreateWithPutUsingAbsoluteUrl() {
|
public void testTransactionCreateWithPutUsingAbsoluteUrl() {
|
||||||
String methodName = "testTransactionCreateWithPutUsingAbsoluteUrl";
|
String methodName = "testTransactionCreateWithPutUsingAbsoluteUrl";
|
||||||
|
@ -1713,7 +1736,7 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest {
|
||||||
|
|
||||||
Bundle respGetBundle = (Bundle) resp.getEntry().get(0).getResource();
|
Bundle respGetBundle = (Bundle) resp.getEntry().get(0).getResource();
|
||||||
assertEquals(1, respGetBundle.getEntry().size());
|
assertEquals(1, respGetBundle.getEntry().size());
|
||||||
assertEquals("testTransactionOrdering" + pass, ((Patient)respGetBundle.getEntry().get(0).getResource()).getName().get(0).getFamily());
|
assertEquals("testTransactionOrdering" + pass, ((Patient) respGetBundle.getEntry().get(0).getResource()).getName().get(0).getFamily());
|
||||||
assertThat(respGetBundle.getLink("self").getUrl(), endsWith("/Patient?identifier=testTransactionOrdering"));
|
assertThat(respGetBundle.getLink("self").getUrl(), endsWith("/Patient?identifier=testTransactionOrdering"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2069,6 +2092,24 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testTransactionWIthInvalidPlaceholder() throws Exception {
|
||||||
|
Bundle res = new Bundle();
|
||||||
|
res.setType(BundleType.TRANSACTION);
|
||||||
|
|
||||||
|
Observation o1 = new Observation();
|
||||||
|
o1.setId("cid:observation1");
|
||||||
|
o1.addIdentifier().setSystem("system").setValue("testTransactionWithRelativeOidIds02");
|
||||||
|
res.addEntry().setResource(o1).getRequest().setMethod(HTTPVerb.POST).setUrl("Observation");
|
||||||
|
|
||||||
|
try {
|
||||||
|
mySystemDao.transaction(mySrd, res);
|
||||||
|
fail();
|
||||||
|
} catch (InvalidRequestException e) {
|
||||||
|
assertEquals("Invalid placeholder ID found: cid:observation1 - Must be of the form 'urn:uuid:[uuid]' or 'urn:oid:[oid]'", e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Format changed, source isn't valid
|
* Format changed, source isn't valid
|
||||||
*/
|
*/
|
||||||
|
@ -2166,24 +2207,6 @@ public class FhirSystemDaoDstu3Test extends BaseJpaDstu3SystemTest {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testTransactionWIthInvalidPlaceholder() throws Exception {
|
|
||||||
Bundle res = new Bundle();
|
|
||||||
res.setType(BundleType.TRANSACTION);
|
|
||||||
|
|
||||||
Observation o1 = new Observation();
|
|
||||||
o1.setId("cid:observation1");
|
|
||||||
o1.addIdentifier().setSystem("system").setValue("testTransactionWithRelativeOidIds02");
|
|
||||||
res.addEntry().setResource(o1).getRequest().setMethod(HTTPVerb.POST).setUrl("Observation");
|
|
||||||
|
|
||||||
try {
|
|
||||||
mySystemDao.transaction(mySrd, res);
|
|
||||||
fail();
|
|
||||||
} catch (InvalidRequestException e) {
|
|
||||||
assertEquals("Invalid placeholder ID found: cid:observation1 - Must be of the form 'urn:uuid:[uuid]' or 'urn:oid:[oid]'", e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTransactionWithInvalidType() {
|
public void testTransactionWithInvalidType() {
|
||||||
Bundle request = new Bundle();
|
Bundle request = new Bundle();
|
||||||
|
|
|
@ -70,6 +70,54 @@ public class FhirResourceDaoR4SearchNoFtTest extends BaseJpaR4Test {
|
||||||
assertThat(ids, contains(moId.getValue()));
|
assertThat(ids, contains(moId.getValue()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testIncludeLinkedObservations() {
|
||||||
|
|
||||||
|
DiagnosticReport dr = new DiagnosticReport();
|
||||||
|
dr.setId("DiagnosticReport/DR");
|
||||||
|
dr.setStatus(DiagnosticReport.DiagnosticReportStatus.FINAL);
|
||||||
|
|
||||||
|
Observation parentObs = new Observation();
|
||||||
|
parentObs.setStatus(ObservationStatus.FINAL);
|
||||||
|
parentObs.setId("Observation/parentObs");
|
||||||
|
|
||||||
|
Observation childObs = new Observation();
|
||||||
|
childObs.setId("Observation/childObs");
|
||||||
|
childObs.setStatus(ObservationStatus.FINAL);
|
||||||
|
|
||||||
|
dr.addResult().setReference("Observation/parentObs").setResource(parentObs);
|
||||||
|
parentObs.addRelated()
|
||||||
|
.setType(Observation.ObservationRelationshipType.HASMEMBER)
|
||||||
|
.setTarget(new Reference(childObs).setReference("Observation/childObs"));
|
||||||
|
childObs.addRelated()
|
||||||
|
.setType(Observation.ObservationRelationshipType.QUALIFIEDBY)
|
||||||
|
.setTarget(new Reference(parentObs).setReference("Observation/parentObs"));
|
||||||
|
|
||||||
|
Bundle input = new Bundle();
|
||||||
|
input.setType(BundleType.TRANSACTION);
|
||||||
|
input.addEntry()
|
||||||
|
.setResource(dr)
|
||||||
|
.getRequest().setMethod(HTTPVerb.PUT).setUrl(dr.getId());
|
||||||
|
input.addEntry()
|
||||||
|
.setResource(parentObs)
|
||||||
|
.getRequest().setMethod(HTTPVerb.PUT).setUrl(parentObs.getId());
|
||||||
|
input.addEntry()
|
||||||
|
.setResource(childObs)
|
||||||
|
.getRequest().setMethod(HTTPVerb.PUT).setUrl(childObs.getId());
|
||||||
|
mySystemDao.transaction(mySrd, input);
|
||||||
|
|
||||||
|
SearchParameterMap params = new SearchParameterMap();
|
||||||
|
params.add("_id", new TokenParam(null, "DR"));
|
||||||
|
params.addInclude(new Include("DiagnosticReport:subject").setRecurse(true));
|
||||||
|
params.addInclude(new Include("DiagnosticReport:result").setRecurse(true));
|
||||||
|
params.addInclude(new Include("Observation:related-target").setRecurse(true));
|
||||||
|
|
||||||
|
IBundleProvider result = myDiagnosticReportDao.search(params);
|
||||||
|
List<String> resultIds = toUnqualifiedVersionlessIdValues(result);
|
||||||
|
assertThat(resultIds, containsInAnyOrder("DiagnosticReport/DR", "Observation/parentObs", "Observation/childObs"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testEmptyChain() {
|
public void testEmptyChain() {
|
||||||
|
|
||||||
|
|
|
@ -1,38 +1,12 @@
|
||||||
package ca.uhn.fhir.jpa.dao.r4;
|
package ca.uhn.fhir.jpa.dao.r4;
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.*;
|
import ca.uhn.fhir.jpa.dao.BaseHapiFhirDao;
|
||||||
import static org.junit.Assert.*;
|
import ca.uhn.fhir.jpa.dao.DaoConfig;
|
||||||
import static org.mockito.Matchers.eq;
|
import ca.uhn.fhir.jpa.dao.SearchParameterMap;
|
||||||
import static org.mockito.Mockito.times;
|
import ca.uhn.fhir.jpa.entity.ResourceEncodingEnum;
|
||||||
import static org.mockito.Mockito.verify;
|
import ca.uhn.fhir.jpa.entity.ResourceTable;
|
||||||
|
import ca.uhn.fhir.jpa.entity.ResourceTag;
|
||||||
import java.io.*;
|
import ca.uhn.fhir.jpa.entity.TagTypeEnum;
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
|
||||||
import org.hl7.fhir.r4.model.*;
|
|
||||||
import org.hl7.fhir.r4.model.Bundle.BundleEntryComponent;
|
|
||||||
import org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent;
|
|
||||||
import org.hl7.fhir.r4.model.Bundle.BundleEntryResponseComponent;
|
|
||||||
import org.hl7.fhir.r4.model.Bundle.BundleType;
|
|
||||||
import org.hl7.fhir.r4.model.Bundle.HTTPVerb;
|
|
||||||
import org.hl7.fhir.r4.model.Observation.ObservationStatus;
|
|
||||||
import org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity;
|
|
||||||
import org.hl7.fhir.instance.model.api.IAnyResource;
|
|
||||||
import org.hl7.fhir.instance.model.api.IIdType;
|
|
||||||
import org.junit.*;
|
|
||||||
import org.mockito.ArgumentCaptor;
|
|
||||||
import org.springframework.transaction.TransactionDefinition;
|
|
||||||
import org.springframework.transaction.TransactionStatus;
|
|
||||||
import org.springframework.transaction.support.*;
|
|
||||||
|
|
||||||
import ca.uhn.fhir.jpa.dao.*;
|
|
||||||
import ca.uhn.fhir.jpa.entity.*;
|
|
||||||
import ca.uhn.fhir.jpa.provider.SystemProviderDstu2Test;
|
import ca.uhn.fhir.jpa.provider.SystemProviderDstu2Test;
|
||||||
import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum;
|
import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum;
|
||||||
import ca.uhn.fhir.model.primitive.IdDt;
|
import ca.uhn.fhir.model.primitive.IdDt;
|
||||||
|
@ -43,6 +17,35 @@ import ca.uhn.fhir.rest.param.ReferenceParam;
|
||||||
import ca.uhn.fhir.rest.server.exceptions.*;
|
import ca.uhn.fhir.rest.server.exceptions.*;
|
||||||
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.ActionRequestDetails;
|
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.ActionRequestDetails;
|
||||||
import ca.uhn.fhir.util.TestUtil;
|
import ca.uhn.fhir.util.TestUtil;
|
||||||
|
import org.apache.commons.io.IOUtils;
|
||||||
|
import org.hl7.fhir.instance.model.api.IAnyResource;
|
||||||
|
import org.hl7.fhir.instance.model.api.IIdType;
|
||||||
|
import org.hl7.fhir.r4.model.*;
|
||||||
|
import org.hl7.fhir.r4.model.Bundle.*;
|
||||||
|
import org.hl7.fhir.r4.model.Observation.ObservationStatus;
|
||||||
|
import org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity;
|
||||||
|
import org.junit.*;
|
||||||
|
import org.mockito.ArgumentCaptor;
|
||||||
|
import org.springframework.transaction.TransactionDefinition;
|
||||||
|
import org.springframework.transaction.TransactionStatus;
|
||||||
|
import org.springframework.transaction.support.TransactionCallback;
|
||||||
|
import org.springframework.transaction.support.TransactionCallbackWithoutResult;
|
||||||
|
import org.springframework.transaction.support.TransactionTemplate;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import static org.hamcrest.Matchers.*;
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
import static org.mockito.Matchers.eq;
|
||||||
|
import static org.mockito.Mockito.times;
|
||||||
|
import static org.mockito.Mockito.verify;
|
||||||
|
|
||||||
public class FhirSystemDaoR4Test extends BaseJpaR4SystemTest {
|
public class FhirSystemDaoR4Test extends BaseJpaR4SystemTest {
|
||||||
|
|
||||||
|
@ -1086,7 +1089,6 @@ public class FhirSystemDaoR4Test extends BaseJpaR4SystemTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTransactionCreateWithInvalidReferenceNumeric() {
|
public void testTransactionCreateWithInvalidReferenceNumeric() {
|
||||||
String methodName = "testTransactionCreateWithInvalidReferenceNumeric";
|
String methodName = "testTransactionCreateWithInvalidReferenceNumeric";
|
||||||
|
@ -1125,6 +1127,27 @@ public class FhirSystemDaoR4Test extends BaseJpaR4SystemTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testTransactionCreateWithLinks() throws IOException {
|
||||||
|
Bundle request = new Bundle();
|
||||||
|
request.setType(BundleType.TRANSACTION);
|
||||||
|
|
||||||
|
Observation o = new Observation();
|
||||||
|
o.setId("A");
|
||||||
|
o.setStatus(ObservationStatus.AMENDED);
|
||||||
|
|
||||||
|
request.addEntry()
|
||||||
|
.setResource(o)
|
||||||
|
.getRequest().setUrl("A").setMethod(HTTPVerb.PUT);
|
||||||
|
|
||||||
|
try {
|
||||||
|
mySystemDao.transaction(mySrd, request);
|
||||||
|
fail();
|
||||||
|
} catch (InvalidRequestException e) {
|
||||||
|
assertEquals("Invalid match URL[A] - URL has no search parameters", e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTransactionCreateWithPutUsingAbsoluteUrl() {
|
public void testTransactionCreateWithPutUsingAbsoluteUrl() {
|
||||||
String methodName = "testTransactionCreateWithPutUsingAbsoluteUrl";
|
String methodName = "testTransactionCreateWithPutUsingAbsoluteUrl";
|
||||||
|
@ -1162,7 +1185,8 @@ public class FhirSystemDaoR4Test extends BaseJpaR4SystemTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTransactionCreateWithPutUsingUrl2() throws Exception {
|
public void testTransactionCreateWithPutUsingUrl2() throws Exception {
|
||||||
String req = IOUtils.toString(FhirSystemDaoR4Test.class.getResourceAsStream("/r4/bundle.xml"), StandardCharsets.UTF_8); Bundle request = myFhirCtx.newXmlParser().parseResource(Bundle.class, req);
|
String req = IOUtils.toString(FhirSystemDaoR4Test.class.getResourceAsStream("/r4/bundle.xml"), StandardCharsets.UTF_8);
|
||||||
|
Bundle request = myFhirCtx.newXmlParser().parseResource(Bundle.class, req);
|
||||||
mySystemDao.transaction(mySrd, request);
|
mySystemDao.transaction(mySrd, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1712,7 +1736,7 @@ public class FhirSystemDaoR4Test extends BaseJpaR4SystemTest {
|
||||||
|
|
||||||
Bundle respGetBundle = (Bundle) resp.getEntry().get(0).getResource();
|
Bundle respGetBundle = (Bundle) resp.getEntry().get(0).getResource();
|
||||||
assertEquals(1, respGetBundle.getEntry().size());
|
assertEquals(1, respGetBundle.getEntry().size());
|
||||||
assertEquals("testTransactionOrdering" + pass, ((Patient)respGetBundle.getEntry().get(0).getResource()).getName().get(0).getFamily());
|
assertEquals("testTransactionOrdering" + pass, ((Patient) respGetBundle.getEntry().get(0).getResource()).getName().get(0).getFamily());
|
||||||
assertThat(respGetBundle.getLink("self").getUrl(), endsWith("/Patient?identifier=testTransactionOrdering"));
|
assertThat(respGetBundle.getLink("self").getUrl(), endsWith("/Patient?identifier=testTransactionOrdering"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2068,6 +2092,24 @@ public class FhirSystemDaoR4Test extends BaseJpaR4SystemTest {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testTransactionWIthInvalidPlaceholder() throws Exception {
|
||||||
|
Bundle res = new Bundle();
|
||||||
|
res.setType(BundleType.TRANSACTION);
|
||||||
|
|
||||||
|
Observation o1 = new Observation();
|
||||||
|
o1.setId("cid:observation1");
|
||||||
|
o1.addIdentifier().setSystem("system").setValue("testTransactionWithRelativeOidIds02");
|
||||||
|
res.addEntry().setResource(o1).getRequest().setMethod(HTTPVerb.POST).setUrl("Observation");
|
||||||
|
|
||||||
|
try {
|
||||||
|
mySystemDao.transaction(mySrd, res);
|
||||||
|
fail();
|
||||||
|
} catch (InvalidRequestException e) {
|
||||||
|
assertEquals("Invalid placeholder ID found: cid:observation1 - Must be of the form 'urn:uuid:[uuid]' or 'urn:oid:[oid]'", e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Format changed, source isn't valid
|
* Format changed, source isn't valid
|
||||||
*/
|
*/
|
||||||
|
@ -2165,24 +2207,6 @@ public class FhirSystemDaoR4Test extends BaseJpaR4SystemTest {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testTransactionWIthInvalidPlaceholder() throws Exception {
|
|
||||||
Bundle res = new Bundle();
|
|
||||||
res.setType(BundleType.TRANSACTION);
|
|
||||||
|
|
||||||
Observation o1 = new Observation();
|
|
||||||
o1.setId("cid:observation1");
|
|
||||||
o1.addIdentifier().setSystem("system").setValue("testTransactionWithRelativeOidIds02");
|
|
||||||
res.addEntry().setResource(o1).getRequest().setMethod(HTTPVerb.POST).setUrl("Observation");
|
|
||||||
|
|
||||||
try {
|
|
||||||
mySystemDao.transaction(mySrd, res);
|
|
||||||
fail();
|
|
||||||
} catch (InvalidRequestException e) {
|
|
||||||
assertEquals("Invalid placeholder ID found: cid:observation1 - Must be of the form 'urn:uuid:[uuid]' or 'urn:oid:[oid]'", e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTransactionWithInvalidType() {
|
public void testTransactionWithInvalidType() {
|
||||||
Bundle request = new Bundle();
|
Bundle request = new Bundle();
|
||||||
|
|
|
@ -1,8 +1,33 @@
|
||||||
package ca.uhn.fhir.rest.server.interceptor;
|
package ca.uhn.fhir.rest.server.interceptor;
|
||||||
|
|
||||||
import static org.apache.commons.lang3.StringUtils.defaultString;
|
import ca.uhn.fhir.parser.IParser;
|
||||||
import static org.apache.commons.lang3.StringUtils.isBlank;
|
import ca.uhn.fhir.rest.api.Constants;
|
||||||
import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
import ca.uhn.fhir.rest.api.EncodingEnum;
|
||||||
|
import ca.uhn.fhir.rest.api.RequestTypeEnum;
|
||||||
|
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
||||||
|
import ca.uhn.fhir.rest.server.RestfulServer;
|
||||||
|
import ca.uhn.fhir.rest.server.RestfulServerUtils;
|
||||||
|
import ca.uhn.fhir.rest.server.RestfulServerUtils.ResponseEncoding;
|
||||||
|
import ca.uhn.fhir.rest.server.exceptions.AuthenticationException;
|
||||||
|
import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException;
|
||||||
|
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||||
|
import ca.uhn.fhir.util.UrlUtil;
|
||||||
|
import org.apache.commons.io.IOUtils;
|
||||||
|
import org.apache.commons.lang3.StringEscapeUtils;
|
||||||
|
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||||
|
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.ServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Enumeration;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import static org.apache.commons.lang3.StringUtils.*;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* #%L
|
* #%L
|
||||||
|
@ -24,28 +49,6 @@ import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
||||||
* #L%
|
* #L%
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import javax.servlet.ServletException;
|
|
||||||
import javax.servlet.ServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
|
||||||
import org.apache.commons.lang3.StringEscapeUtils;
|
|
||||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
|
||||||
|
|
||||||
import ca.uhn.fhir.parser.IParser;
|
|
||||||
import ca.uhn.fhir.rest.api.*;
|
|
||||||
import ca.uhn.fhir.rest.api.server.RequestDetails;
|
|
||||||
import ca.uhn.fhir.rest.server.RestfulServer;
|
|
||||||
import ca.uhn.fhir.rest.server.RestfulServerUtils;
|
|
||||||
import ca.uhn.fhir.rest.server.RestfulServerUtils.ResponseEncoding;
|
|
||||||
import ca.uhn.fhir.rest.server.exceptions.*;
|
|
||||||
import ca.uhn.fhir.util.UrlUtil;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interceptor detects when a request is coming from a browser, and automatically returns a response with syntax
|
* This interceptor detects when a request is coming from a browser, and automatically returns a response with syntax
|
||||||
* highlighted (coloured) HTML for the response instead of just returning raw XML/JSON.
|
* highlighted (coloured) HTML for the response instead of just returning raw XML/JSON.
|
||||||
|
@ -54,10 +57,6 @@ import ca.uhn.fhir.util.UrlUtil;
|
||||||
*/
|
*/
|
||||||
public class ResponseHighlighterInterceptor extends InterceptorAdapter {
|
public class ResponseHighlighterInterceptor extends InterceptorAdapter {
|
||||||
|
|
||||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ResponseHighlighterInterceptor.class);
|
|
||||||
private static final String[] PARAM_FORMAT_VALUE_JSON = new String[] { Constants.FORMAT_JSON };
|
|
||||||
private static final String[] PARAM_FORMAT_VALUE_XML = new String[] { Constants.FORMAT_XML };
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: As of HAPI 1.6 (2016-06-10) this parameter has been replaced with simply
|
* TODO: As of HAPI 1.6 (2016-06-10) this parameter has been replaced with simply
|
||||||
* requesting _format=json or xml so eventually this parameter should be removed
|
* requesting _format=json or xml so eventually this parameter should be removed
|
||||||
|
@ -65,7 +64,9 @@ public class ResponseHighlighterInterceptor extends InterceptorAdapter {
|
||||||
public static final String PARAM_RAW = "_raw";
|
public static final String PARAM_RAW = "_raw";
|
||||||
public static final String PARAM_RAW_TRUE = "true";
|
public static final String PARAM_RAW_TRUE = "true";
|
||||||
public static final String PARAM_TRUE = "true";
|
public static final String PARAM_TRUE = "true";
|
||||||
|
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ResponseHighlighterInterceptor.class);
|
||||||
|
private static final String[] PARAM_FORMAT_VALUE_JSON = new String[]{Constants.FORMAT_JSON};
|
||||||
|
private static final String[] PARAM_FORMAT_VALUE_XML = new String[]{Constants.FORMAT_XML};
|
||||||
private boolean myShowRequestHeaders = false;
|
private boolean myShowRequestHeaders = false;
|
||||||
private boolean myShowResponseHeaders = true;
|
private boolean myShowResponseHeaders = true;
|
||||||
|
|
||||||
|
@ -267,6 +268,18 @@ public class ResponseHighlighterInterceptor extends InterceptorAdapter {
|
||||||
return myShowRequestHeaders;
|
return myShowRequestHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If set to <code>true</code> (default is <code>false</code>) response will include the
|
||||||
|
* request headers
|
||||||
|
*
|
||||||
|
* @return Returns a reference to this for easy method chaining
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
|
public ResponseHighlighterInterceptor setShowRequestHeaders(boolean theShowRequestHeaders) {
|
||||||
|
myShowRequestHeaders = theShowRequestHeaders;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If set to <code>true</code> (default is <code>true</code>) response will include the
|
* If set to <code>true</code> (default is <code>true</code>) response will include the
|
||||||
* response headers
|
* response headers
|
||||||
|
@ -275,6 +288,18 @@ public class ResponseHighlighterInterceptor extends InterceptorAdapter {
|
||||||
return myShowResponseHeaders;
|
return myShowResponseHeaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If set to <code>true</code> (default is <code>true</code>) response will include the
|
||||||
|
* response headers
|
||||||
|
*
|
||||||
|
* @return Returns a reference to this for easy method chaining
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
|
public ResponseHighlighterInterceptor setShowResponseHeaders(boolean theShowResponseHeaders) {
|
||||||
|
myShowResponseHeaders = theShowResponseHeaders;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean outgoingResponse(RequestDetails theRequestDetails, IBaseResource theResponseObject, HttpServletRequest theServletRequest, HttpServletResponse theServletResponse)
|
public boolean outgoingResponse(RequestDetails theRequestDetails, IBaseResource theResponseObject, HttpServletRequest theServletRequest, HttpServletResponse theServletResponse)
|
||||||
throws AuthenticationException {
|
throws AuthenticationException {
|
||||||
|
@ -345,30 +370,6 @@ public class ResponseHighlighterInterceptor extends InterceptorAdapter {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* If set to <code>true</code> (default is <code>false</code>) response will include the
|
|
||||||
* request headers
|
|
||||||
*
|
|
||||||
* @return Returns a reference to this for easy method chaining
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("UnusedReturnValue")
|
|
||||||
public ResponseHighlighterInterceptor setShowRequestHeaders(boolean theShowRequestHeaders) {
|
|
||||||
myShowRequestHeaders = theShowRequestHeaders;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If set to <code>true</code> (default is <code>true</code>) response will include the
|
|
||||||
* response headers
|
|
||||||
*
|
|
||||||
* @return Returns a reference to this for easy method chaining
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("UnusedReturnValue")
|
|
||||||
public ResponseHighlighterInterceptor setShowResponseHeaders(boolean theShowResponseHeaders) {
|
|
||||||
myShowResponseHeaders = theShowResponseHeaders;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void streamRequestHeaders(ServletRequest theServletRequest, StringBuilder b) {
|
private void streamRequestHeaders(ServletRequest theServletRequest, StringBuilder b) {
|
||||||
if (theServletRequest instanceof HttpServletRequest) {
|
if (theServletRequest instanceof HttpServletRequest) {
|
||||||
HttpServletRequest sr = (HttpServletRequest) theServletRequest;
|
HttpServletRequest sr = (HttpServletRequest) theServletRequest;
|
||||||
|
@ -479,14 +480,21 @@ public class ResponseHighlighterInterceptor extends InterceptorAdapter {
|
||||||
b.append(" font-family: monospace;\n");
|
b.append(" font-family: monospace;\n");
|
||||||
b.append("}");
|
b.append("}");
|
||||||
b.append(".responseBodyTable {");
|
b.append(".responseBodyTable {");
|
||||||
b.append(" width: 100%;");
|
b.append(" width: 100%;\n");
|
||||||
b.append(" margin-left: 0px;");
|
b.append(" margin-left: 0px;\n");
|
||||||
b.append(" margin-top: 20px;");
|
b.append(" margin-top: -10px;\n");
|
||||||
|
b.append(" position: relative;\n");
|
||||||
b.append("}");
|
b.append("}");
|
||||||
b.append(".responseBodyTableFirstColumn {");
|
b.append(".responseBodyTableFirstColumn {");
|
||||||
|
b.append(" position: absolute;\n");
|
||||||
|
b.append(" width: 70px;\n");
|
||||||
b.append("}");
|
b.append("}");
|
||||||
b.append(".responseBodyTableSecondColumn {");
|
b.append(".responseBodyTableSecondColumn {");
|
||||||
b.append(" width: 100%;");
|
b.append(" position: absolute;\n");
|
||||||
|
b.append(" margin-left: 70px;\n");
|
||||||
|
b.append(" vertical-align: top;\n");
|
||||||
|
b.append(" left: 0px;\n");
|
||||||
|
b.append(" right: 0px;\n");
|
||||||
b.append("}");
|
b.append("}");
|
||||||
b.append(".lineAnchor A {");
|
b.append(".lineAnchor A {");
|
||||||
b.append(" text-decoration: none;");
|
b.append(" text-decoration: none;");
|
||||||
|
@ -571,13 +579,19 @@ public class ResponseHighlighterInterceptor extends InterceptorAdapter {
|
||||||
// ignore (this will hit if we're running in a servlet 2.5 environment)
|
// ignore (this will hit if we're running in a servlet 2.5 environment)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
b.append("<h1>Response Body</h1>");
|
||||||
|
|
||||||
|
b.append("<div class=\"responseBodyTable\">");
|
||||||
|
|
||||||
|
// Response Body
|
||||||
|
b.append("<div class=\"responseBodyTableSecondColumn\"><pre>");
|
||||||
StringBuilder target = new StringBuilder();
|
StringBuilder target = new StringBuilder();
|
||||||
int linesCount = format(encoded, target, encoding);
|
int linesCount = format(encoded, target, encoding);
|
||||||
|
b.append(target);
|
||||||
|
b.append("</pre></div>");
|
||||||
|
|
||||||
b.append("<table class=\"responseBodyTable\" cellspacing=\"0\">");
|
// Line Numbers
|
||||||
b.append("<tr>");
|
b.append("<div class=\"responseBodyTableFirstColumn\"><pre>");
|
||||||
|
|
||||||
b.append("<td class=\"responseBodyTableFirstColumn\"><pre>");
|
|
||||||
for (int i = 1; i <= linesCount; i++) {
|
for (int i = 1; i <= linesCount; i++) {
|
||||||
b.append("<div class=\"lineAnchor\" id=\"anchor");
|
b.append("<div class=\"lineAnchor\" id=\"anchor");
|
||||||
b.append(i);
|
b.append(i);
|
||||||
|
@ -593,15 +607,9 @@ public class ResponseHighlighterInterceptor extends InterceptorAdapter {
|
||||||
b.append(i);
|
b.append(i);
|
||||||
b.append("</a></div>");
|
b.append("</a></div>");
|
||||||
}
|
}
|
||||||
b.append("</pre></td>");
|
b.append("</div></td>");
|
||||||
|
|
||||||
// Response Body
|
b.append("</div>");
|
||||||
b.append("<td class=\"responseBodyTableSecondColumn\"><pre>");
|
|
||||||
b.append(target);
|
|
||||||
b.append("</pre></td>");
|
|
||||||
|
|
||||||
b.append("</tr>");
|
|
||||||
b.append("</table>");
|
|
||||||
|
|
||||||
b.append("\n");
|
b.append("\n");
|
||||||
|
|
||||||
|
@ -614,9 +622,7 @@ public class ResponseHighlighterInterceptor extends InterceptorAdapter {
|
||||||
|
|
||||||
b.append("</body>");
|
b.append("</body>");
|
||||||
b.append("</html>");
|
b.append("</html>");
|
||||||
//@formatter:off
|
|
||||||
String out = b.toString();
|
String out = b.toString();
|
||||||
//@formatter:on
|
|
||||||
|
|
||||||
theServletResponse.getWriter().append(out);
|
theServletResponse.getWriter().append(out);
|
||||||
theServletResponse.getWriter().close();
|
theServletResponse.getWriter().close();
|
||||||
|
@ -627,7 +633,7 @@ public class ResponseHighlighterInterceptor extends InterceptorAdapter {
|
||||||
|
|
||||||
private void streamResponseHeaders(RequestDetails theRequestDetails, HttpServletResponse theServletResponse, StringBuilder b) {
|
private void streamResponseHeaders(RequestDetails theRequestDetails, HttpServletResponse theServletResponse, StringBuilder b) {
|
||||||
if (theServletResponse.getHeaderNames().isEmpty() == false) {
|
if (theServletResponse.getHeaderNames().isEmpty() == false) {
|
||||||
b.append("<h1>Response</h1>");
|
b.append("<h1>Response Headers</h1>");
|
||||||
|
|
||||||
b.append("<div class=\"headersDiv\">");
|
b.append("<div class=\"headersDiv\">");
|
||||||
for (String nextHeaderName : theServletResponse.getHeaderNames()) {
|
for (String nextHeaderName : theServletResponse.getHeaderNames()) {
|
||||||
|
|
|
@ -14,6 +14,7 @@ import static org.junit.Assert.assertTrue;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
@ -80,6 +81,14 @@ public class ResponseHighlightingInterceptorTest {
|
||||||
ourInterceptor.setShowResponseHeaders(new ResponseHighlighterInterceptor().isShowResponseHeaders());
|
ourInterceptor.setShowResponseHeaders(new ResponseHighlighterInterceptor().isShowResponseHeaders());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For interactive testing only
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void waitForInput() throws IOException {
|
||||||
|
System.in.read();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See #464
|
* See #464
|
||||||
*/
|
*/
|
||||||
|
@ -661,6 +670,7 @@ public class ResponseHighlightingInterceptorTest {
|
||||||
assertEquals(Constants.CT_FHIR_JSON + ";charset=utf-8", status.getFirstHeader("content-type").getValue().replace(" ", "").toLowerCase());
|
assertEquals(Constants.CT_FHIR_JSON + ";charset=utf-8", status.getFirstHeader("content-type").getValue().replace(" ", "").toLowerCase());
|
||||||
assertThat(responseContent, not(containsString("html")));
|
assertThat(responseContent, not(containsString("html")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testForceApplicationJsonPlusFhir() throws Exception {
|
public void testForceApplicationJsonPlusFhir() throws Exception {
|
||||||
HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/1?_format=" + UrlUtil.escape("application/json+fhir"));
|
HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/1?_format=" + UrlUtil.escape("application/json+fhir"));
|
||||||
|
|
Loading…
Reference in New Issue