mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
ACS-3376 Simplify method of obtaining rule ids.
This commit is contained in:
@@ -35,7 +35,6 @@ import java.util.List;
|
||||
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.rest.api.impl.mapper.rules.RestRuleModelMapper;
|
||||
import org.alfresco.rest.api.model.rules.Rule;
|
||||
import org.alfresco.rest.api.model.rules.RuleSet;
|
||||
import org.alfresco.service.Experimental;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
@@ -152,8 +151,8 @@ public class RuleSetLoader
|
||||
private List<String> loadRuleIds(NodeRef folderNodeRef)
|
||||
{
|
||||
return ruleService.getRules(folderNodeRef, false).stream()
|
||||
.map(restRuleModelMapper::toRestModel)
|
||||
.map(Rule::getId)
|
||||
.map(org.alfresco.service.cmr.rule.Rule::getNodeRef)
|
||||
.map(NodeRef::getId)
|
||||
.collect(toList());
|
||||
}
|
||||
|
||||
|
@@ -90,6 +90,7 @@ public class RuleSetLoaderTest extends TestCase
|
||||
given(nodeServiceMock.getParentAssocs(RULE_SET_NODE)).willReturn(List.of(ruleSetAssociationMock, linkAssociationMock));
|
||||
|
||||
given(ruleServiceMock.getFoldersInheritingRuleSet(eq(RULE_SET_NODE), anyInt())).willReturn(List.of(INHERITING_FOLDER));
|
||||
given(ruleServiceMock.getFoldersLinkingToRuleSet(RULE_SET_NODE)).willReturn(List.of(LINKING_FOLDER));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user