From de701a6b7f8fb719c35cae3dc86dd0c9aabf4a5c Mon Sep 17 00:00:00 2001 From: Alin Date: Mon, 9 Jul 2018 15:35:50 +0300 Subject: [PATCH 1/3] added patch for operation outcome --- .../rest/server/method/BaseOutcomeReturningMethodBinding.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/BaseOutcomeReturningMethodBinding.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/BaseOutcomeReturningMethodBinding.java index ea92f5c5b79..407c4fb2df1 100644 --- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/BaseOutcomeReturningMethodBinding.java +++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/method/BaseOutcomeReturningMethodBinding.java @@ -48,7 +48,7 @@ import java.util.Set; abstract class BaseOutcomeReturningMethodBinding extends BaseMethodBinding { static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BaseOutcomeReturningMethodBinding.class); - private static EnumSet ourOperationsWhichAllowPreferHeader = EnumSet.of(RestOperationTypeEnum.CREATE, RestOperationTypeEnum.UPDATE); + private static EnumSet ourOperationsWhichAllowPreferHeader = EnumSet.of(RestOperationTypeEnum.CREATE, RestOperationTypeEnum.UPDATE, RestOperationTypeEnum.PATCH); private boolean myReturnVoid; @@ -91,11 +91,11 @@ abstract class BaseOutcomeReturningMethodBinding extends BaseMethodBinding Date: Mon, 9 Jul 2018 16:23:04 +0300 Subject: [PATCH 2/3] fixed the testWritePatchByInstance return code based on fhir doc --- .../interceptor/auth/AuthorizationInterceptorDstu2Test.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorDstu2Test.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorDstu2Test.java index fe70c2e20bb..3fd96f88573 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorDstu2Test.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptorDstu2Test.java @@ -1786,7 +1786,7 @@ public class AuthorizationInterceptorDstu2Test { httpPost.setEntity(new StringEntity(input, ContentType.parse("application/json-patch+json"))); status = ourClient.execute(httpPost); response = extractResponseAndClose(status); - assertEquals(204, status.getStatusLine().getStatusCode()); + assertEquals(200, status.getStatusLine().getStatusCode()); assertTrue(ourHitMethod); } From 62c7c0fa55c8c9c6545a87519edcb04899e5a859 Mon Sep 17 00:00:00 2001 From: Alin Date: Mon, 9 Jul 2018 16:43:31 +0300 Subject: [PATCH 3/3] fixed the AuthorizationInterceptorR4Test return code based on fhir doc --- .../server/interceptor/AuthorizationInterceptorR4Test.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/AuthorizationInterceptorR4Test.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/AuthorizationInterceptorR4Test.java index 33ad4feabb9..5df78a7ba23 100644 --- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/AuthorizationInterceptorR4Test.java +++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/AuthorizationInterceptorR4Test.java @@ -1647,7 +1647,7 @@ public class AuthorizationInterceptorR4Test { patch.setEntity(new StringEntity(patchBody, ContentType.create(Constants.CT_JSON_PATCH, Charsets.UTF_8))); CloseableHttpResponse status = ourClient.execute(patch); extractResponseAndClose(status); - assertEquals(204, status.getStatusLine().getStatusCode()); + assertEquals(200, status.getStatusLine().getStatusCode()); assertTrue(ourHitMethod); } @@ -2924,7 +2924,7 @@ public class AuthorizationInterceptorR4Test { httpPost.setEntity(new StringEntity(input, ContentType.parse("application/json-patch+json"))); status = ourClient.execute(httpPost); extractResponseAndClose(status); - assertEquals(204, status.getStatusLine().getStatusCode()); + assertEquals(200, status.getStatusLine().getStatusCode()); assertTrue(ourHitMethod); }