From c75c96db08877203d00d1df9efd9186c079dbfb6 Mon Sep 17 00:00:00 2001 From: sb-cecilialiu Date: Thu, 5 Dec 2024 08:14:27 -0600 Subject: [PATCH] MAT-7842 hapi fhir update --- pom.xml | 4 ++-- .../controllers/CqlLibraryControllerTest.java | 3 ++- .../services/CqlLibraryServiceAclTest.java | 3 ++- .../services/LibrarySetServiceTest.java | 12 ++++++------ 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index 5a5c9b1..b5e5659 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.springframework.boot spring-boot-starter-parent - 3.3.5 + 3.4.0 @@ -107,7 +107,7 @@ gov.cms.madie madie-rest-commons - 0.0.6-SNAPSHOT + 0.0.8-SNAPSHOT org.apache.commons diff --git a/src/test/java/gov/cms/madie/cqllibraryservice/controllers/CqlLibraryControllerTest.java b/src/test/java/gov/cms/madie/cqllibraryservice/controllers/CqlLibraryControllerTest.java index c8e3d20..46e5f3d 100644 --- a/src/test/java/gov/cms/madie/cqllibraryservice/controllers/CqlLibraryControllerTest.java +++ b/src/test/java/gov/cms/madie/cqllibraryservice/controllers/CqlLibraryControllerTest.java @@ -553,7 +553,8 @@ public void testUpdateAccessControl() { when(cqlLibraryService.updateAccessControlList(anyString(), any())) .thenReturn(aclSpecifications); - ResponseEntity> output = cqlLibraryController.updateAccessControl(request, "1", aclOperation, "key"); + ResponseEntity> output = + cqlLibraryController.updateAccessControl(request, "1", aclOperation, "key"); verify(cqlLibraryService, times(1)).updateAccessControlList(anyString(), any()); assertThat(output.getBody(), equalTo(aclSpecifications)); diff --git a/src/test/java/gov/cms/madie/cqllibraryservice/services/CqlLibraryServiceAclTest.java b/src/test/java/gov/cms/madie/cqllibraryservice/services/CqlLibraryServiceAclTest.java index 2f3839f..7922ff1 100644 --- a/src/test/java/gov/cms/madie/cqllibraryservice/services/CqlLibraryServiceAclTest.java +++ b/src/test/java/gov/cms/madie/cqllibraryservice/services/CqlLibraryServiceAclTest.java @@ -48,7 +48,8 @@ public void testUpdateAccessControlListWithNoLibrary() { Exception ex = assertThrows( - ResourceNotFoundException.class, () -> cqlLibraryService.updateAccessControlList(library.getId(), aclOperation)); + ResourceNotFoundException.class, + () -> cqlLibraryService.updateAccessControlList(library.getId(), aclOperation)); assertEquals(ex.getMessage(), "Library does not exist: " + library.getId()); } diff --git a/src/test/java/gov/cms/madie/cqllibraryservice/services/LibrarySetServiceTest.java b/src/test/java/gov/cms/madie/cqllibraryservice/services/LibrarySetServiceTest.java index 8d5198a..f67825c 100644 --- a/src/test/java/gov/cms/madie/cqllibraryservice/services/LibrarySetServiceTest.java +++ b/src/test/java/gov/cms/madie/cqllibraryservice/services/LibrarySetServiceTest.java @@ -70,7 +70,8 @@ public void testGrantOperationNoLibrarySetFound() { Exception ex = assertThrows( - ResourceNotFoundException.class, () -> librarySetService.updateLibrarySetAcls(librarySetId, aclOperation)); + ResourceNotFoundException.class, + () -> librarySetService.updateLibrarySetAcls(librarySetId, aclOperation)); assertEquals(ex.getMessage(), "Could not find resource LibrarySet with id: " + librarySetId); } @@ -94,10 +95,8 @@ public void testGrantOperationAsFirstNewAcl() { @Test public void testGrantOperationAsFirstNewAclWithNoAclsInLibrarySet() { - LibrarySet librarySetWithNoAcls = LibrarySet.builder() - .librarySetId("1") - .owner("user-1") - .build(); + LibrarySet librarySetWithNoAcls = + LibrarySet.builder().librarySetId("1").owner("user-1").build(); AclSpecification aclSpec = new AclSpecification(); aclSpec.setUserId("john_1"); aclSpec.setRoles(Set.of(RoleEnum.SHARED_WITH)); @@ -105,7 +104,8 @@ public void testGrantOperationAsFirstNewAclWithNoAclsInLibrarySet() { AclOperation.builder().acls(List.of(aclSpec)).action(AclOperation.AclAction.GRANT).build(); LibrarySet updatedLibrarySet = LibrarySet.builder().librarySetId("1").owner("john_1").acls(List.of(aclSpec)).build(); - when(librarySetRepository.findByLibrarySetId(anyString())).thenReturn(Optional.of(librarySetWithNoAcls)); + when(librarySetRepository.findByLibrarySetId(anyString())) + .thenReturn(Optional.of(librarySetWithNoAcls)); when(librarySetRepository.save(any(LibrarySet.class))).thenReturn(updatedLibrarySet); LibrarySet librarySet = librarySetService.updateLibrarySetAcls("1", aclOperation);