Skip to content

Commit

Permalink
LPD-43452 rename
Browse files Browse the repository at this point in the history
  • Loading branch information
AliciaGarciaGarcia authored and brianchandotcom committed Dec 16, 2024
1 parent 2c4fe1f commit 95f1b27
Showing 1 changed file with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,20 @@ public void testAddEmptyNameVocabulary() throws Exception {
AssetTestUtil.addVocabulary(_group.getGroupId(), StringPool.BLANK);
}

@Test
public void testAddVocabulary() throws Exception {
AssetVocabulary vocabulary = AssetTestUtil.addVocabulary(
_group.getGroupId(), RandomTestUtil.randomString());

_testAddVocabulary(
String.valueOf(vocabulary.getPrimaryKey()), RoleConstants.GUEST);
_testAddVocabulary(
String.valueOf(vocabulary.getPrimaryKey()), RoleConstants.OWNER);
_testAddVocabulary(
String.valueOf(vocabulary.getPrimaryKey()),
RoleConstants.SITE_MEMBER);
}

@Test
public void testAddVocabularyWithExternalReferenceCode() throws Exception {
String externalReferenceCode = StringUtil.randomString();
Expand Down Expand Up @@ -163,20 +177,6 @@ public void testAddVocabularyWithoutExternalReferenceCode()
Assert.assertEquals(vocabulary1, vocabulary2);
}

@Test
public void testAddVocabularyWithViewPermission() throws Exception {
AssetVocabulary vocabulary = AssetTestUtil.addVocabulary(
_group.getGroupId(), RandomTestUtil.randomString());

_testAddVocabularyWithViewPermission(
String.valueOf(vocabulary.getPrimaryKey()), RoleConstants.GUEST);
_testAddVocabularyWithViewPermission(
String.valueOf(vocabulary.getPrimaryKey()), RoleConstants.OWNER);
_testAddVocabularyWithViewPermission(
String.valueOf(vocabulary.getPrimaryKey()),
RoleConstants.SITE_MEMBER);
}

@Test
public void testDeleteVocabulary() throws Exception {
int initialAssetCategoriesCount = searchCount();
Expand Down Expand Up @@ -566,8 +566,7 @@ protected int searchCount() throws Exception {
return results.getLength();
}

private void _testAddVocabularyWithViewPermission(
String primKey, String roleName)
private void _testAddVocabulary(String primKey, String roleName)
throws Exception {

Role role = _roleLocalService.getRole(_group.getCompanyId(), roleName);
Expand Down

0 comments on commit 95f1b27

Please sign in to comment.