This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hotfix: remove check user when update institution (#479)
- Loading branch information
Showing
2 changed files
with
2 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -589,8 +589,6 @@ void updateInstitution_shouldThrowExceptionIfGeotaxNotFound() { | |
when(partyRegistryProxyConnector.getExtByCode(any())) | ||
.thenThrow(new ResourceNotFoundException("An error occurred", "Code")); | ||
|
||
when(userService.checkIfInstitutionUser(any(), any())).thenReturn(true); | ||
|
||
ArrayList<InstitutionGeographicTaxonomies> institutionGeographicTaxonomiesList = new ArrayList<>(); | ||
institutionGeographicTaxonomiesList | ||
.add(new InstitutionGeographicTaxonomies("Code", "The characteristics of someone or something")); | ||
|
@@ -616,41 +614,6 @@ void updateInstitution_shouldThrowExceptionIfGeotaxNotFound() { | |
assertThrows(MsCoreException.class, | ||
() -> institutionServiceImpl.updateInstitution("42", institutionUpdate, "42")); | ||
verify(partyRegistryProxyConnector).getExtByCode(any()); | ||
verify(userService).checkIfInstitutionUser(any(), any()); | ||
} | ||
|
||
/** | ||
* Method under test: {@link InstitutionServiceImpl#updateInstitution(String, InstitutionUpdate, String)} | ||
*/ | ||
@Test | ||
void testUpdateInstitution7() { | ||
when(userService.checkIfInstitutionUser(any(), any())).thenReturn(false); | ||
|
||
ArrayList<InstitutionGeographicTaxonomies> institutionGeographicTaxonomiesList = new ArrayList<>(); | ||
institutionGeographicTaxonomiesList | ||
.add(new InstitutionGeographicTaxonomies("Code", "The characteristics of someone or something")); | ||
|
||
InstitutionUpdate institutionUpdate = new InstitutionUpdate(); | ||
institutionUpdate.setAddress("42 Main St"); | ||
institutionUpdate.setBusinessRegisterPlace("Business Register Place"); | ||
institutionUpdate | ||
.setDataProtectionOfficer(new DataProtectionOfficer("42 Main St", "[email protected]", "Pec")); | ||
institutionUpdate.setDescription("The characteristics of someone or something"); | ||
institutionUpdate.setDigitalAddress("42 Main St"); | ||
institutionUpdate.setGeographicTaxonomies(institutionGeographicTaxonomiesList); | ||
institutionUpdate.setImported(true); | ||
institutionUpdate.setInstitutionType(InstitutionType.PA); | ||
institutionUpdate | ||
.setPaymentServiceProvider(new PaymentServiceProvider("Abi Code", "42", "Legal Register Name", "42", true)); | ||
institutionUpdate.setRea("Rea"); | ||
institutionUpdate.setShareCapital("Share Capital"); | ||
institutionUpdate.setSupportEmail("[email protected]"); | ||
institutionUpdate.setSupportPhone("6625550144"); | ||
institutionUpdate.setTaxCode("Tax Code"); | ||
institutionUpdate.setZipCode("21654"); | ||
assertThrows(ResourceForbiddenException.class, | ||
() -> institutionServiceImpl.updateInstitution("42", institutionUpdate, "42")); | ||
verify(userService).checkIfInstitutionUser(any(), any()); | ||
} | ||
|
||
/** | ||
|
@@ -1303,17 +1266,10 @@ void testRetrieveInstitutionsWithFilter6() { | |
|
||
@Test | ||
void testUpdateInstitutionDescription() { | ||
when(userService.checkIfInstitutionUser(any(), any())).thenReturn(true); | ||
when(institutionConnector.findAndUpdate(any(), any(), any(), any())).thenReturn(new Institution()); | ||
assertDoesNotThrow(() -> institutionServiceImpl.updateInstitution("42", new InstitutionUpdate(), "userId")); | ||
} | ||
|
||
@Test | ||
void testUpdateInstitutionDescriptionException() { | ||
when(userService.checkIfInstitutionUser(any(), any())).thenReturn(false); | ||
assertThrows(ResourceForbiddenException.class, () -> institutionServiceImpl.updateInstitution("42", new InstitutionUpdate(), "userId")); | ||
} | ||
|
||
@Test | ||
void updateCreatedAt() { | ||
// Given | ||
|