test_class.declarator: helper
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private TestHelper helper;
test_class.type: TestHelper
test_class.var_name: helper
test_class.declarator: testProvisioningExceptionProcessor
test_class.modifier: @Autowired 
  	private
test_class.original_string: @Autowired 
  	private TestProvisioningExceptionProcessor testProvisioningExceptionProcessor;
test_class.type: TestProvisioningExceptionProcessor
test_class.var_name: testProvisioningExceptionProcessor
test_class.declarator: testAccountExceptionProcessor
test_class.modifier: @Autowired 
  	private
test_class.original_string: @Autowired 
  	private TestAccountExceptionProcessor testAccountExceptionProcessor;
test_class.type: TestAccountExceptionProcessor
test_class.var_name: testAccountExceptionProcessor
test_class.declarator: longRunningTaskService
test_class.modifier: @Autowired 
  	private
test_class.original_string: @Autowired 
  	private IdmLongRunningTaskService longRunningTaskService;
test_class.type: IdmLongRunningTaskService
test_class.var_name: longRunningTaskService
test_class.file: Realization/backend/acc/src/test/java/eu/bcvsolutions/idm/acc/bulk/action/impl/RoleAccountManagementBulkActionTest.java
test_class.identifier: RoleAccountManagementBulkActionTest
test_class.superclass: extends AbstractBulkActionTest
test_case.body: @Test
  	public void testPrevalidationBulkAction() {
  		IdmRoleDto role = getHelper().createRole();
  		
  		IdmBulkActionDto bulkAction = this.findBulkAction(IdmRole.class, RoleAccountManagementBulkAction.NAME);
  		bulkAction.getIdentifiers().add(role.getId());
  		
  		// Warning message, role hasn't identity
  		ResultModels resultModels = bulkActionManager.prevalidate(bulkAction);
  		assertEquals(1, resultModels.getInfos().size());
  		assertEquals(AccResultCode.ROLE_ACM_BULK_ACTION_NONE_IDENTITIES.getCode(), resultModels.getInfos().get(0).getStatusEnum());
  		// Assign identity to role
  		IdmIdentityDto identity = getHelper().createIdentity();
  		getHelper().createIdentityRole(identity, role);
  		
  		// Info message, role has identity
  		resultModels = bulkActionManager.prevalidate(bulkAction);
  		assertEquals(1, resultModels.getInfos().size());
  		assertEquals(AccResultCode.ROLE_ACM_BULK_ACTION_NUMBER_OF_IDENTITIES.getCode(), resultModels.getInfos().get(0).getStatusEnum());
  	}
test_case.class_method_signature: RoleAccountManagementBulkActionTest.testPrevalidationBulkAction()
test_case.full_signature: @Test public void testPrevalidationBulkAction()
test_case.identifier: testPrevalidationBulkAction
test_case.invocations: createRole getHelper findBulkAction add getIdentifiers getId prevalidate assertEquals size getInfos assertEquals getCode getStatusEnum get getInfos createIdentity getHelper createIdentityRole getHelper prevalidate assertEquals size getInfos assertEquals getCode getStatusEnum get getInfos
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPrevalidationBulkAction()
focal_class.declarator: LOG = LoggerFactory.getLogger(RoleAccountManagementBulkAction.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(RoleAccountManagementBulkAction.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: NAME = "role-acm-bulk-action"
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME = "role-acm-bulk-action";
focal_class.type: String
focal_class.var_name: NAME
focal_class.declarator: roleService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private IdmRoleService roleService;
focal_class.type: IdmRoleService
focal_class.var_name: roleService
focal_class.declarator: identityRoleService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private IdmIdentityRoleService identityRoleService;
focal_class.type: IdmIdentityRoleService
focal_class.var_name: identityRoleService
focal_class.declarator: accountManagementService
focal_class.modifier: @Autowired 
  	private
focal_class.original_string: @Autowired 
  	private AccAccountManagementService accountManagementService;
focal_class.type: AccAccountManagementService
focal_class.var_name: accountManagementService
focal_class.declarator: provisioningService
focal_class.modifier: @Autowired 
  	private
focal_class.original_string: @Autowired 
  	private ProvisioningService provisioningService;
focal_class.type: ProvisioningService
focal_class.var_name: provisioningService
focal_class.declarator: accountService
focal_class.modifier: @Autowired 
  	private
focal_class.original_string: @Autowired 
  	private AccAccountService accountService;
focal_class.type: AccAccountService
focal_class.var_name: accountService
focal_class.file: Realization/backend/acc/src/main/java/eu/bcvsolutions/idm/acc/bulk/action/impl/RoleAccountManagementBulkAction.java
focal_class.identifier: RoleAccountManagementBulkAction
focal_class.class_method_signature: RoleAccountManagementBulkAction.processDto(IdmRoleDto dto)
focal_class.full_signature: @Override protected OperationResult processDto(IdmRoleDto dto)
focal_class.identifier: processDto
focal_class.modifiers: @Override protected
focal_class.parameters: (IdmRoleDto dto)
focal_class.return: OperationResult
focal_class.signature: OperationResult processDto(IdmRoleDto dto)
focal_class.class_method_signature: RoleAccountManagementBulkAction.prevalidate()
focal_class.full_signature: @Override public ResultModels prevalidate()
focal_class.identifier: prevalidate
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: ResultModels
focal_class.signature: ResultModels prevalidate()
focal_class.class_method_signature: RoleAccountManagementBulkAction.getAuthoritiesForEntity()
focal_class.full_signature: @Override protected List<String> getAuthoritiesForEntity()
focal_class.identifier: getAuthoritiesForEntity
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: List<String>
focal_class.signature: List<String> getAuthoritiesForEntity()
focal_class.class_method_signature: RoleAccountManagementBulkAction.getName()
focal_class.full_signature: @Override public String getName()
focal_class.identifier: getName
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getName()
focal_class.class_method_signature: RoleAccountManagementBulkAction.getOrder()
focal_class.full_signature: @Override public int getOrder()
focal_class.identifier: getOrder
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getOrder()
focal_class.class_method_signature: RoleAccountManagementBulkAction.getService()
focal_class.full_signature: @Override public ReadWriteDtoService<IdmRoleDto, IdmRoleFilter> getService()
focal_class.identifier: getService
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: ReadWriteDtoService<IdmRoleDto, IdmRoleFilter>
focal_class.signature: ReadWriteDtoService<IdmRoleDto, IdmRoleFilter> getService()
focal_class.class_method_signature: RoleAccountManagementBulkAction.getEmbeddedIdentity(IdmIdentityRoleDto identityRole)
focal_class.full_signature: private IdmIdentityDto getEmbeddedIdentity(IdmIdentityRoleDto identityRole)
focal_class.identifier: getEmbeddedIdentity
focal_class.modifiers: private
focal_class.parameters: (IdmIdentityRoleDto identityRole)
focal_class.return: IdmIdentityDto
focal_class.signature: IdmIdentityDto getEmbeddedIdentity(IdmIdentityRoleDto identityRole)
focal_class.superclass: extends AbstractBulkAction<IdmRoleDto, IdmRoleFilter>
focal_method.body: @Override
  	public ResultModels prevalidate() {
  		IdmBulkActionDto action = getAction();
  		List<UUID> entities = getEntities(action, new StringBuilder());
  		ResultModels result = new ResultModels();
  
  		Map<ResultModel, Long> models = new HashMap<>();
  		entities.forEach(roleId -> {
  			IdmIdentityRoleFilter identityRoleFilter = new IdmIdentityRoleFilter();
  			identityRoleFilter.setRoleId(roleId);
  			IdmRoleDto role = getService().get(roleId);
  
  			long count = identityRoleService.find(identityRoleFilter, PageRequest.of(0, 1)).getTotalElements();
  			if (count > 0) {
  				models.put(new DefaultResultModel(AccResultCode.ROLE_ACM_BULK_ACTION_NUMBER_OF_IDENTITIES,
  						ImmutableMap.of("role", role.getCode(), "count", count)), count);
  			}
  		});
  
  		boolean someIdentitiesFound = models.values() //
  				.stream() //
  				.filter(count -> count > 0) //
  				.findFirst() //
  				.isPresent(); //
  
  		if (!someIdentitiesFound) {
  			result.addInfo(new DefaultResultModel(AccResultCode.ROLE_ACM_BULK_ACTION_NONE_IDENTITIES));
  		} else {
  			// Sort by count
  			List<Entry<ResultModel, Long>> collect = models //
  					.entrySet() //
  					.stream() //
  					.sorted(Collections.reverseOrder(Map.Entry.comparingByValue())) //
  					.limit(5) //
  					.collect(Collectors.toList()); //
  			collect.forEach(entry -> {
  				result.addInfo(entry.getKey());
  			});
  		}
  
  		return result;
  	}
focal_method.class_method_signature: RoleAccountManagementBulkAction.prevalidate()
focal_method.full_signature: @Override public ResultModels prevalidate()
focal_method.identifier: prevalidate
focal_method.invocations: getAction getEntities forEach setRoleId get getService getTotalElements find of put of getCode isPresent findFirst filter stream values addInfo collect limit sorted stream entrySet reverseOrder comparingByValue toList forEach addInfo getKey
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: ResultModels
focal_method.signature: ResultModels prevalidate()