use of it.cnr.cool.security.service.impl.alfresco.CMISGroup in project cool-jconon by consiglionazionaledellericerche.
the class CommonRestTest method testGetMd5Single.
@Test
public void testGetMd5Single() throws Exception {
List<CMISGroup> groups = new ArrayList<>();
groups.add(new CMISGroup("foo", "bar"));
String md5 = CommonRest.getMd5(groups);
assertEquals("acbd18db4cc2f85cedef654fccc4a4d8", md5);
}
use of it.cnr.cool.security.service.impl.alfresco.CMISGroup in project cool-jconon by consiglionazionaledellericerche.
the class CommonRestTest method testGetMd5Multiple.
@Test
public void testGetMd5Multiple() throws Exception {
List<CMISGroup> groups = new ArrayList<>();
groups.add(new CMISGroup("baz", "baz"));
groups.add(new CMISGroup("foo", "foo"));
groups.add(new CMISGroup("bar", "bar"));
String md5 = CommonRest.getMd5(groups);
assertEquals("f08a3a47141ec5368b0ff672c7e14dee", md5);
}
use of it.cnr.cool.security.service.impl.alfresco.CMISGroup in project cool-jconon by consiglionazionaledellericerche.
the class CommonRest method getMd5.
static String getMd5(List<CMISGroup> cmisGroups) {
if (cmisGroups == null) {
return "";
}
List<String> groups = new ArrayList<>();
for (CMISGroup group : cmisGroups) {
String group_name = group.getGroup_name();
LOGGER.debug(group_name);
groups.add(group_name);
}
Collections.sort(groups);
String groupsConcatenation = StringUtils.collectionToDelimitedString(groups, "-");
LOGGER.debug(groupsConcatenation);
String md5 = StringUtil.getMd5(groupsConcatenation.getBytes());
LOGGER.debug(md5);
return md5;
}