From b5953af2390125ec0c58cabe4fc2520aa69f2975 Mon Sep 17 00:00:00 2001 From: souradeepsaha Date: Tue, 30 May 2023 09:42:12 -0400 Subject: [PATCH] Remove Forbid from hapi-fhir and add to cdr --- .../interceptor/ConsentInterceptorTest.java | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/ConsentInterceptorTest.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/ConsentInterceptorTest.java index d7cc5a2ed42..62f51a32573 100644 --- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/ConsentInterceptorTest.java +++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/server/interceptor/ConsentInterceptorTest.java @@ -156,38 +156,6 @@ public class ConsentInterceptorTest { verify(myConsentSvc, timeout(2000).times(0)).completeOperationFailure(any(), any(), any()); } - @Test - public void testConsentCanSeeResourceForbid() throws IOException { - Patient patientA = new Patient(); - patientA.setId("PT-1-0"); - patientA.setActive(true); - patientA.addName().setFamily("FAMILY").addGiven("GIVEN"); - patientA.addIdentifier().setSystem("SYSTEM").setValue("VALUEA"); - - ourPatientProvider.store(patientA); - - when(myConsentSvc.startOperation(any(), any())).thenReturn(ConsentOutcome.PROCEED); - when(myConsentSvc.canSeeResource(any(), any(), any())).thenReturn(ConsentOutcome.FORBID); - - HttpPut httpPut = new HttpPut("http://localhost:" + myPort + "/Patient/PT-1-0"); - httpPut.setHeader(HttpHeaders.CONTENT_TYPE, "application/json"); - - httpPut.setEntity(new StringEntity("{\"resourceType\": \"Patient\",\"id\": \"PT-1-0\",\"text\": {\"status\": \"generated\",\"div\": \"

A valid patient resource for testing purposes

\"},\"gender\": \"male\"}")); - - try (CloseableHttpResponse status = myClient.execute(httpPut)) { - String responseContent = IOUtils.toString(status.getEntity().getContent(), Charsets.UTF_8); - System.out.println("here"); - ourLog.info("Response: {}", responseContent); - assertEquals(403, status.getStatusLine().getStatusCode()); - //String responseContent = IOUtils.toString(status.getEntity().getContent(), Charsets.UTF_8); - System.out.println("here"); - ourLog.info("Response: {}", responseContent); - } - - verify(myConsentSvc, timeout(2000).times(1)).completeOperationSuccess(any(), any()); - verify(myConsentSvc, timeout(2000).times(0)).completeOperationFailure(any(), any(), any()); - } - @Test public void testTotalModeIgnoredForConsentQueries() throws IOException { Patient patientA = new Patient();