@Test public void testCleanupVirtualGroups() { virtualGroupService.cleanupVirtualGroups(ACCOUNT_ID, ENV_CRN); verify(grpcUmsClient, times(UmsRight.values().length)).deleteWorkloadAdministrationGroupName(crnCaptor.capture(), eq(ACCOUNT_ID), eq(Optional.empty()), rightCaptor.capture(), eq(ENV_CRN)); assertEquals(INTERNAL_ACTOR_CRN, crnCaptor.getValue()); for (UmsRight right : UmsRight.values()) { assertTrue(rightCaptor.getAllValues().contains(right.getRight())); } }
public void cleanupVirtualGroups(String accountId, String environmentCrn) { for (UmsRight right : UmsRight.values()) { try { LOGGER.debug("Start deleting virtual groups from UMS for environment '{}'", environmentCrn); grpcUmsClient.deleteWorkloadAdministrationGroupName(INTERNAL_ACTOR_CRN, accountId, MDCUtils.getRequestId(), right.getRight(), environmentCrn); LOGGER.debug("Virtual groups deletion from UMS has been finished successfully for environment '{}'", environmentCrn); } catch (RuntimeException ex) { LOGGER.warn("UMS virtualgroup delete failed (this is not critical)", ex); } } }
VirtualGroupService { public void cleanupVirtualGroups(String accountId, String environmentCrn) { for (UmsRight right : UmsRight.values()) { try { LOGGER.debug("Start deleting virtual groups from UMS for environment '{}'", environmentCrn); grpcUmsClient.deleteWorkloadAdministrationGroupName(INTERNAL_ACTOR_CRN, accountId, MDCUtils.getRequestId(), right.getRight(), environmentCrn); LOGGER.debug("Virtual groups deletion from UMS has been finished successfully for environment '{}'", environmentCrn); } catch (RuntimeException ex) { LOGGER.warn("UMS virtualgroup delete failed (this is not critical)", ex); } } } }
VirtualGroupService { public void cleanupVirtualGroups(String accountId, String environmentCrn) { for (UmsRight right : UmsRight.values()) { try { LOGGER.debug("Start deleting virtual groups from UMS for environment '{}'", environmentCrn); grpcUmsClient.deleteWorkloadAdministrationGroupName(INTERNAL_ACTOR_CRN, accountId, MDCUtils.getRequestId(), right.getRight(), environmentCrn); LOGGER.debug("Virtual groups deletion from UMS has been finished successfully for environment '{}'", environmentCrn); } catch (RuntimeException ex) { LOGGER.warn("UMS virtualgroup delete failed (this is not critical)", ex); } } }  }
VirtualGroupService { public void cleanupVirtualGroups(String accountId, String environmentCrn) { for (UmsRight right : UmsRight.values()) { try { LOGGER.debug("Start deleting virtual groups from UMS for environment '{}'", environmentCrn); grpcUmsClient.deleteWorkloadAdministrationGroupName(INTERNAL_ACTOR_CRN, accountId, MDCUtils.getRequestId(), right.getRight(), environmentCrn); LOGGER.debug("Virtual groups deletion from UMS has been finished successfully for environment '{}'", environmentCrn); } catch (RuntimeException ex) { LOGGER.warn("UMS virtualgroup delete failed (this is not critical)", ex); } } }  Map<UmsRight, String> createVirtualGroups(String accountId, String environmentCrn); String getVirtualGroup(VirtualGroupRequest virtualGroupRequest, String right); void cleanupVirtualGroups(String accountId, String environmentCrn); }
VirtualGroupService { public void cleanupVirtualGroups(String accountId, String environmentCrn) { for (UmsRight right : UmsRight.values()) { try { LOGGER.debug("Start deleting virtual groups from UMS for environment '{}'", environmentCrn); grpcUmsClient.deleteWorkloadAdministrationGroupName(INTERNAL_ACTOR_CRN, accountId, MDCUtils.getRequestId(), right.getRight(), environmentCrn); LOGGER.debug("Virtual groups deletion from UMS has been finished successfully for environment '{}'", environmentCrn); } catch (RuntimeException ex) { LOGGER.warn("UMS virtualgroup delete failed (this is not critical)", ex); } } }  Map<UmsRight, String> createVirtualGroups(String accountId, String environmentCrn); String getVirtualGroup(VirtualGroupRequest virtualGroupRequest, String right); void cleanupVirtualGroups(String accountId, String environmentCrn);  }