44import ca .uhn .fhir .rest .api .MethodOutcome ;
55import ca .uhn .fhir .rest .client .api .IGenericClient ;
66import ca .uhn .fhir .rest .gclient .ICreateTyped ;
7- import ca .uhn .fhir .rest .server .exceptions .AuthenticationException ;
87import ca .uhn .fhir .rest .server .exceptions .InvalidRequestException ;
8+ import ca .uhn .fhir .rest .server .exceptions .ResourceNotFoundException ;
99import ca .uhn .fhir .rest .server .exceptions .UnprocessableEntityException ;
1010import gov .cms .dpc .api .APITestHelpers ;
1111import gov .cms .dpc .api .AbstractSecureApplicationTest ;
@@ -133,7 +133,7 @@ void testMissingProvenance() throws IOException {
133133 }
134134
135135 @ Test
136- public void testInvalidInputsWhenCreatingGroup () throws IOException {
136+ void testInvalidInputsWhenCreatingGroup () throws IOException {
137137 final IParser parser = ctx .newJsonParser ();
138138 IGenericClient client = APIAuthHelpers .buildAuthenticatedClient (ctx , getBaseURL (), ORGANIZATION_TOKEN , PUBLIC_KEY_ID , PRIVATE_KEY );
139139 APITestHelpers .setupPatientTest (client , parser );
@@ -253,7 +253,7 @@ void testCreateInvalidGroup() throws IOException, URISyntaxException {
253253 }
254254
255255 @ Test
256- public void testCreateGroupReturnsAppropriateHeaders () throws IOException {
256+ void testCreateGroupReturnsAppropriateHeaders () throws IOException {
257257 final IParser parser = ctx .newJsonParser ();
258258 IGenericClient client = APIAuthHelpers .buildAuthenticatedClient (ctx , getBaseURL (), ORGANIZATION_TOKEN , PUBLIC_KEY_ID , PRIVATE_KEY );
259259 APITestHelpers .setupPatientTest (client , parser );
@@ -340,7 +340,7 @@ public void testCreateGroupReturnsAppropriateHeaders() throws IOException {
340340 }
341341
342342 @ Test
343- public void testProvenanceHeaderAndGroupProviderMatch () {
343+ void testProvenanceHeaderAndGroupProviderMatch () {
344344 IGenericClient client = APIAuthHelpers .buildAuthenticatedClient (ctx , getBaseURL (), ORGANIZATION_TOKEN , PUBLIC_KEY_ID , PRIVATE_KEY );
345345 Practitioner practitioner = APITestHelpers .createPractitionerResource (NPIUtil .generateNPI (), ORGANIZATION_ID );
346346
@@ -401,7 +401,7 @@ public void testProvenanceHeaderAndGroupProviderMatch() {
401401 }
402402
403403 @ Test
404- public void testGroupCanOnlyBeRetrievedByOwner () throws GeneralSecurityException , IOException , URISyntaxException , ParseException {
404+ void testGroupCanOnlyBeRetrievedByOwner () throws GeneralSecurityException , IOException , URISyntaxException , ParseException {
405405 final TestOrganizationContext orgAContext = registerAndSetupNewOrg ();
406406 final TestOrganizationContext orgBContext = registerAndSetupNewOrg ();
407407 final IGenericClient orgAClient = APIAuthHelpers .buildAuthenticatedClient (ctx , getBaseURL (), orgAContext .getClientToken (), UUID .fromString (orgAContext .getPublicKeyId ()), orgAContext .getPrivateKey ());
@@ -432,7 +432,7 @@ public void testGroupCanOnlyBeRetrievedByOwner() throws GeneralSecurityException
432432 assertEquals (orgBGroup .getId (), foundGroup .getId (), "Returned group ID should have been the same as requested ID" );
433433
434434
435- assertThrows (AuthenticationException .class , () ->
435+ assertThrows (ResourceNotFoundException .class , () ->
436436 orgBClient .read ()
437437 .resource (Group .class )
438438 .withId (orgAGroup .getId ())
@@ -442,7 +442,7 @@ public void testGroupCanOnlyBeRetrievedByOwner() throws GeneralSecurityException
442442 }
443443
444444 @ Test
445- public void testOrgCanOnlyDeleteTheirOwnGroup () throws GeneralSecurityException , IOException , URISyntaxException , ParseException {
445+ void testOrgCanOnlyDeleteTheirOwnGroup () throws GeneralSecurityException , IOException , URISyntaxException , ParseException {
446446 final TestOrganizationContext orgAContext = registerAndSetupNewOrg ();
447447 final TestOrganizationContext orgBContext = registerAndSetupNewOrg ();
448448 final IGenericClient orgAClient = APIAuthHelpers .buildAuthenticatedClient (ctx , getBaseURL (), orgAContext .getClientToken (), UUID .fromString (orgAContext .getPublicKeyId ()), orgAContext .getPrivateKey ());
@@ -455,7 +455,7 @@ public void testOrgCanOnlyDeleteTheirOwnGroup() throws GeneralSecurityException,
455455 Group orgBGroup = createAndSubmitGroup (orgBContext .getOrgId (), orgBPractitioner , orgBClient , Collections .emptyList ());
456456
457457 Provenance provenance = APITestHelpers .createProvenance (orgBContext .getOrgId (), orgBPractitioner .getId (), Collections .emptyList ());
458- assertThrows (AuthenticationException .class , () ->
458+ assertThrows (ResourceNotFoundException .class , () ->
459459 orgBClient .delete ()
460460 .resource (orgAGroup )
461461 .encodedJson ()
@@ -472,7 +472,7 @@ public void testOrgCanOnlyDeleteTheirOwnGroup() throws GeneralSecurityException,
472472 }
473473
474474 @ Test
475- public void testOrgCanOnlyUpdateTheirOwnGroup () throws GeneralSecurityException , IOException , URISyntaxException , ParseException {
475+ void testOrgCanOnlyUpdateTheirOwnGroup () throws GeneralSecurityException , IOException , URISyntaxException , ParseException {
476476 final TestOrganizationContext orgAContext = registerAndSetupNewOrg ();
477477 final TestOrganizationContext orgBContext = registerAndSetupNewOrg ();
478478 final IGenericClient orgAClient = APIAuthHelpers .buildAuthenticatedClient (ctx , getBaseURL (), orgAContext .getClientToken (), UUID .fromString (orgAContext .getPublicKeyId ()), orgAContext .getPrivateKey ());
@@ -485,7 +485,7 @@ public void testOrgCanOnlyUpdateTheirOwnGroup() throws GeneralSecurityException,
485485 Group orgBGroup = createAndSubmitGroup (orgBContext .getOrgId (), orgBPractitioner , orgBClient , Collections .emptyList ());
486486
487487 Provenance provenance = APITestHelpers .createProvenance (orgBContext .getOrgId (), orgBPractitioner .getId (), Collections .emptyList ());
488- assertThrows (AuthenticationException .class , () ->
488+ assertThrows (ResourceNotFoundException .class , () ->
489489 orgBClient .update ().resource (orgAGroup )
490490 .encodedJson ()
491491 .withAdditionalHeader ("X-Provenance" , ctx .newJsonParser ().encodeResourceToString (provenance ))
@@ -501,7 +501,7 @@ public void testOrgCanOnlyUpdateTheirOwnGroup() throws GeneralSecurityException,
501501 }
502502
503503 @ Test
504- public void testOrgCanOnlyListTheirOwnGroups () throws GeneralSecurityException , IOException , URISyntaxException , ParseException {
504+ void testOrgCanOnlyListTheirOwnGroups () throws GeneralSecurityException , IOException , URISyntaxException , ParseException {
505505 final TestOrganizationContext orgAContext = registerAndSetupNewOrg ();
506506 final TestOrganizationContext orgBContext = registerAndSetupNewOrg ();
507507 final IGenericClient orgAClient = APIAuthHelpers .buildAuthenticatedClient (ctx , getBaseURL (), orgAContext .getClientToken (), UUID .fromString (orgAContext .getPublicKeyId ()), orgAContext .getPrivateKey ());
@@ -525,7 +525,7 @@ public void testOrgCanOnlyListTheirOwnGroups() throws GeneralSecurityException,
525525
526526
527527 @ Test
528- public void testOrgCanOnlyCreateGroupWithPatientsTheyManage () throws GeneralSecurityException , IOException , URISyntaxException , ParseException {
528+ void testOrgCanOnlyCreateGroupWithPatientsTheyManage () throws GeneralSecurityException , IOException , URISyntaxException , ParseException {
529529 final TestOrganizationContext orgAContext = registerAndSetupNewOrg ();
530530 final TestOrganizationContext orgBContext = registerAndSetupNewOrg ();
531531 final IGenericClient orgAClient = APIAuthHelpers .buildAuthenticatedClient (ctx , getBaseURL (), orgAContext .getClientToken (), UUID .fromString (orgAContext .getPublicKeyId ()), orgAContext .getPrivateKey ());
@@ -553,7 +553,7 @@ public void testOrgCanOnlyCreateGroupWithPatientsTheyManage() throws GeneralSecu
553553 }
554554
555555 @ Test
556- public void testOrgCanOnlyUpdateGroupWithPatientsTheyManage () throws GeneralSecurityException , IOException , URISyntaxException , ParseException {
556+ void testOrgCanOnlyUpdateGroupWithPatientsTheyManage () throws GeneralSecurityException , IOException , URISyntaxException , ParseException {
557557 final TestOrganizationContext orgAContext = registerAndSetupNewOrg ();
558558 final TestOrganizationContext orgBContext = registerAndSetupNewOrg ();
559559 final IGenericClient orgAClient = APIAuthHelpers .buildAuthenticatedClient (ctx , getBaseURL (), orgAContext .getClientToken (), UUID .fromString (orgAContext .getPublicKeyId ()), orgAContext .getPrivateKey ());
@@ -582,7 +582,7 @@ public void testOrgCanOnlyUpdateGroupWithPatientsTheyManage() throws GeneralSecu
582582
583583
584584 @ Test
585- public void testOrgCanOnlyAddPatientsTheyManageToGroup () throws IOException , URISyntaxException , GeneralSecurityException , ParseException {
585+ void testOrgCanOnlyAddPatientsTheyManageToGroup () throws IOException , URISyntaxException , GeneralSecurityException , ParseException {
586586 final TestOrganizationContext orgAContext = registerAndSetupNewOrg ();
587587 final TestOrganizationContext orgBContext = registerAndSetupNewOrg ();
588588 final IGenericClient orgAClient = APIAuthHelpers .buildAuthenticatedClient (ctx , getBaseURL (), orgAContext .getClientToken (), UUID .fromString (orgAContext .getPublicKeyId ()), orgAContext .getPrivateKey ());
0 commit comments