From 5ef31a505ce7c99ae2c764fce007bd9fd84c84d5 Mon Sep 17 00:00:00 2001 From: James Agnew Date: Sun, 12 Aug 2018 21:36:26 -0400 Subject: [PATCH] One more test fix --- .../ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4Test.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4Test.java index a729040446e..ba4fa167387 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4Test.java @@ -2410,6 +2410,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { } HttpPatch patch = new HttpPatch(ourServerBase + "/Patient/" + pid1.getIdPart()); + patch.addHeader(Constants.HEADER_PREFER, Constants.HEADER_PREFER_RETURN + '=' + Constants.HEADER_PREFER_RETURN_OPERATION_OUTCOME); patch.setEntity(new StringEntity("[ { \"op\":\"replace\", \"path\":\"/active\", \"value\":false } ]", ContentType.parse(Constants.CT_JSON_PATCH + Constants.CHARSET_UTF8_CTSUFFIX))); CloseableHttpResponse response = ourHttpClient.execute(patch); @@ -2471,8 +2472,9 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { } HttpPatch patch = new HttpPatch(ourServerBase + "/Patient/" + pid1.getIdPart()); - patch.setEntity(new StringEntity("[ { \"op\":\"replace\", \"path\":\"/active\", \"value\":false } ]", ContentType.parse(Constants.CT_JSON_PATCH + Constants.CHARSET_UTF8_CTSUFFIX))); + patch.addHeader(Constants.HEADER_PREFER, Constants.HEADER_PREFER_RETURN + '=' + Constants.HEADER_PREFER_RETURN_OPERATION_OUTCOME); patch.addHeader("If-Match", "W/\"1\""); + patch.setEntity(new StringEntity("[ { \"op\":\"replace\", \"path\":\"/active\", \"value\":false } ]", ContentType.parse(Constants.CT_JSON_PATCH + Constants.CHARSET_UTF8_CTSUFFIX))); CloseableHttpResponse response = ourHttpClient.execute(patch); try { @@ -2503,6 +2505,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test { HttpPatch patch = new HttpPatch(ourServerBase + "/Patient/" + pid1.getIdPart()); String patchString = "false"; + patch.addHeader(Constants.HEADER_PREFER, Constants.HEADER_PREFER_RETURN + '=' + Constants.HEADER_PREFER_RETURN_OPERATION_OUTCOME); patch.setEntity(new StringEntity(patchString, ContentType.parse(Constants.CT_XML_PATCH + Constants.CHARSET_UTF8_CTSUFFIX))); CloseableHttpResponse response = ourHttpClient.execute(patch);