Rename authority and person exceptions for MNT-20764 (#978)

This commit is contained in:
Abdul Mohammed
2020-05-01 17:05:00 +01:00
parent f1f9d6d4a7
commit d5470a3e15
4 changed files with 6 additions and 6 deletions

View File

@@ -1670,7 +1670,7 @@ public class AuthorityDAOImpl implements AuthorityDAO, NodeServicePolicies.Befor
{ {
if (authorityName.indexOf(illegalCharacter) != -1) if (authorityName.indexOf(illegalCharacter) != -1)
{ {
throw new AlfrescoRuntimeException("Group name contains characters that are not permitted: "+authorityName.charAt(authorityName.indexOf(illegalCharacter))); throw new AuthorityException("Group name contains characters that are not permitted: "+authorityName.charAt(authorityName.indexOf(illegalCharacter)));
} }
} }
} }

View File

@@ -1797,7 +1797,7 @@ public class PersonServiceImpl extends TransactionListenerAdapter implements Per
{ {
if (userName.indexOf(illegalCharacter) != -1) if (userName.indexOf(illegalCharacter) != -1)
{ {
throw new AlfrescoRuntimeException("Person name contains characters that are not permitted: "+userName.charAt(userName.indexOf(illegalCharacter))); throw new PersonException("Person name contains characters that are not permitted: "+userName.charAt(userName.indexOf(illegalCharacter)));
} }
} }
} }

View File

@@ -261,9 +261,9 @@ public class AuthorityServiceTest extends TestCase
try try
{ {
authorityService.createAuthority(AuthorityType.GROUP, groupName); authorityService.createAuthority(AuthorityType.GROUP, groupName);
fail("AlfrescoRuntimeException not caught for illegalCharacter: " +groupName.charAt(groupName.indexOf(illegalCharacter))); fail("AuthorityException not caught for illegalCharacter: " +groupName.charAt(groupName.indexOf(illegalCharacter)));
} }
catch (AlfrescoRuntimeException ignored) catch (AuthorityException ignored)
{ {
// Expected // Expected
} }

View File

@@ -467,9 +467,9 @@ public class PersonTest extends TestCase
try try
{ {
personService.createPerson(createDefaultProperties(personName, "Some", "User", "some.user@example.com", "alfresco", rootNodeRef)); personService.createPerson(createDefaultProperties(personName, "Some", "User", "some.user@example.com", "alfresco", rootNodeRef));
fail("AlfrescoRuntimeException not caught for illegalCharacter: " +personName.charAt(personName.indexOf(illegalCharacter))); fail("PersonException not caught for illegalCharacter: " +personName.charAt(personName.indexOf(illegalCharacter)));
} }
catch (AlfrescoRuntimeException ignored) catch (PersonException ignored)
{ {
// Expected // Expected
} }