From 7753ccad0676bd5129e29366ae530536e5e151c8 Mon Sep 17 00:00:00 2001 From: Silviu Dinuta Date: Thu, 10 Nov 2016 16:58:05 +0200 Subject: [PATCH] RM-4327: changed InvalidParameterException with IntegrityException --- .../model/BaseBehaviourBean.java | 16 ++++++------ .../model/rma/type/RmSiteType.java | 6 ++--- .../model/rma/type/TransferContainerType.java | 5 ++-- .../model/rma/type/TransferType.java | 5 ++-- .../test/integration/issue/RM3341Test.java | 7 +++-- .../test/integration/issue/RM3450Test.java | 5 ++-- .../model/rma/type/FilePlanTypeUnitTest.java | 10 +++---- .../rma/type/HoldContainerTypeUnitTest.java | 7 +++-- .../model/rma/type/RmSiteTypeUnitTest.java | 26 +++++++++---------- .../type/TransferContainerTypeUnitTest.java | 7 +++-- .../model/rma/type/TransferTypeUnitTest.java | 7 +++-- .../UnfiledRecordContainerTypeUnitTest.java | 7 +++-- .../type/UnfiledRecordFolderTypeUnitTest.java | 7 +++-- 13 files changed, 53 insertions(+), 62 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/BaseBehaviourBean.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/BaseBehaviourBean.java index 734b7d34e9..de61dcc7c7 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/BaseBehaviourBean.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/BaseBehaviourBean.java @@ -27,13 +27,13 @@ package org.alfresco.module.org_alfresco_module_rm.model; -import java.security.InvalidParameterException; import java.util.HashMap; import java.util.List; import java.util.Map; import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.module.org_alfresco_module_rm.util.ServiceBaseImpl; +import org.alfresco.repo.node.integrity.IntegrityException; import org.alfresco.repo.policy.BehaviourFilter; import org.alfresco.repo.policy.annotation.BehaviourRegistry; import org.alfresco.service.cmr.repository.NodeRef; @@ -99,9 +99,9 @@ public abstract class BaseBehaviourBean extends ServiceBaseImpl * @param childType the child node * @param acceptedUniqueChildType a list of node types that are accepted as children of the provided parent only once * @param acceptedMultipleChildType a list of node types that are accepted as children of the provided parent multiple times - * @throws InvalidParameterException if the child association doesn't comply with the RM rules + * @throws IntegrityException if the child association doesn't comply with the RM rules */ - protected void validateNewChildAssociation(NodeRef parent, NodeRef child, List acceptedUniqueChildType, List acceptedMultipleChildType) throws InvalidParameterException + protected void validateNewChildAssociation(NodeRef parent, NodeRef child, List acceptedUniqueChildType, List acceptedMultipleChildType) throws IntegrityException { QName childType = getInternalNodeService().getType(child); if(acceptedUniqueChildType.contains(childType)) @@ -109,12 +109,12 @@ public abstract class BaseBehaviourBean extends ServiceBaseImpl // check the user is not trying to create multiple children of a type that is only accepted once if(nodeService.getChildAssocs(parent, Sets.newHashSet(childType)).size() > 1) { - throw new InvalidParameterException("Operation failed. Multiple children of this type are not allowed."); + throw new IntegrityException("Operation failed. Multiple children of this type are not allowed.", null); } } else if(!acceptedMultipleChildType.contains(childType)) { - throw new InvalidParameterException("Operation failed. Children of type " + childType + " are not allowed"); + throw new IntegrityException("Operation failed. Children of type " + childType + " are not allowed", null); } } @@ -122,9 +122,9 @@ public abstract class BaseBehaviourBean extends ServiceBaseImpl * Helper method that checks if the newly created child association is between the sub-types of accepted types. * @param childType the child node * @param acceptedMultipleChildType a list of node types that are accepted as children of the provided parent multiple times - * @throws InvalidParameterException if the child association isn't between the sub-types of accepted types + * @throws IntegrityException if the child association isn't between the sub-types of accepted types */ - protected void validateNewChildAssociationSubTypesIncluded(NodeRef child, List acceptedMultipleChildType) throws InvalidParameterException + protected void validateNewChildAssociationSubTypesIncluded(NodeRef child, List acceptedMultipleChildType) throws IntegrityException { QName childType = getInternalNodeService().getType(child); for(QName type : acceptedMultipleChildType) @@ -135,6 +135,6 @@ public abstract class BaseBehaviourBean extends ServiceBaseImpl } } //no match was found in sub-types of permitted types list - throw new InvalidParameterException("Operation failed. Children of type " + childType + " are not allowed"); + throw new IntegrityException("Operation failed. Children of type " + childType + " are not allowed", null); } } diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java index 9068216fb3..4dce98a20c 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteType.java @@ -28,7 +28,6 @@ package org.alfresco.module.org_alfresco_module_rm.model.rma.type; import java.io.Serializable; -import java.security.InvalidParameterException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -41,6 +40,7 @@ import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService; import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean; import org.alfresco.module.org_alfresco_module_rm.search.RecordsManagementSearchService; import org.alfresco.repo.node.NodeServicePolicies; +import org.alfresco.repo.node.integrity.IntegrityException; import org.alfresco.repo.policy.Behaviour.NotificationFrequency; import org.alfresco.repo.policy.annotation.Behaviour; import org.alfresco.repo.policy.annotation.BehaviourBean; @@ -343,14 +343,14 @@ public class RmSiteType extends BaseBehaviourBean */ @Override protected void validateNewChildAssociation(NodeRef parent, NodeRef child, List acceptedUniqueChildType, - List acceptedMultipleChildType) throws InvalidParameterException + List acceptedMultipleChildType) throws IntegrityException { super.validateNewChildAssociation(parent, child, acceptedUniqueChildType, acceptedMultipleChildType); // check the user is not trying to create more than 2 folders that are created by default. if(nodeService.getChildAssocs(parent, Sets.newHashSet(ContentModel.TYPE_FOLDER)).size() > 2) { - throw new InvalidParameterException("Operation failed. Children of type " + ContentModel.TYPE_FOLDER + " are not allowed"); + throw new IntegrityException("Operation failed. Children of type " + ContentModel.TYPE_FOLDER + " are not allowed", null); } } } diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/TransferContainerType.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/TransferContainerType.java index b46fd8c711..6c9657a543 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/TransferContainerType.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/TransferContainerType.java @@ -26,12 +26,11 @@ */ package org.alfresco.module.org_alfresco_module_rm.model.rma.type; -import java.security.InvalidParameterException; - import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.model.ContentModel; import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean; import org.alfresco.repo.node.NodeServicePolicies; +import org.alfresco.repo.node.integrity.IntegrityException; import org.alfresco.repo.policy.annotation.Behaviour; import org.alfresco.repo.policy.annotation.BehaviourBean; import org.alfresco.repo.policy.annotation.BehaviourKind; @@ -84,7 +83,7 @@ public class TransferContainerType extends BaseBehaviourBean ) public void onCreateChildAssociation(ChildAssociationRef childAssocRef, boolean bNew) { - throw new InvalidParameterException("Operation failed. Creation is not allowed in Transfer Container"); + throw new IntegrityException("Operation failed. Creation is not allowed in Transfer Container", null); } @Override diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/TransferType.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/TransferType.java index 268caa0165..0d8bba494d 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/TransferType.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/TransferType.java @@ -27,10 +27,9 @@ package org.alfresco.module.org_alfresco_module_rm.model.rma.type; -import java.security.InvalidParameterException; - import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean; import org.alfresco.repo.node.NodeServicePolicies; +import org.alfresco.repo.node.integrity.IntegrityException; import org.alfresco.repo.policy.annotation.Behaviour; import org.alfresco.repo.policy.annotation.BehaviourBean; import org.alfresco.repo.policy.annotation.BehaviourKind; @@ -76,6 +75,6 @@ public class TransferType extends BaseBehaviourBean implements NodeServicePolici ) public void onCreateChildAssociation(ChildAssociationRef childAssocRef, boolean isNewNode) { - throw new InvalidParameterException("Operation failed. Creation is not allowed in Transfer Folders"); + throw new IntegrityException("Operation failed. Creation is not allowed in Transfer Folders", null); } } diff --git a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM3341Test.java b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM3341Test.java index e729e9ac7a..623399f628 100644 --- a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM3341Test.java +++ b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM3341Test.java @@ -27,11 +27,10 @@ */ package org.alfresco.module.org_alfresco_module_rm.test.integration.issue; -import java.security.InvalidParameterException; - import org.alfresco.model.ContentModel; import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel; import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase; +import org.alfresco.repo.node.integrity.IntegrityException; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.security.AccessStatus; @@ -78,7 +77,7 @@ public class RM3341Test extends BaseRMTestCase fileFolderService.create(holdContainer, "test file", ContentModel.TYPE_CONTENT); fail("This should have thrown an exception"); } - catch (InvalidParameterException e) + catch (IntegrityException e) { // ("Content can't be added to a hold container. Use record folders to file content.") } @@ -104,7 +103,7 @@ public class RM3341Test extends BaseRMTestCase fail("This should have thrown an exception"); } - catch (InvalidParameterException e) + catch (IntegrityException e) { // ("Content can't be added to a transfer container. Use record folders to file content.") } diff --git a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM3450Test.java b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM3450Test.java index 02ff9dd758..e2d031f057 100644 --- a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM3450Test.java +++ b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM3450Test.java @@ -26,10 +26,9 @@ */ package org.alfresco.module.org_alfresco_module_rm.test.integration.issue; -import java.security.InvalidParameterException; - import org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase; import org.alfresco.module.org_alfresco_module_rm.test.util.TestModel; +import org.alfresco.repo.node.integrity.IntegrityException; import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; import org.alfresco.util.GUID; import org.springframework.extensions.surf.util.I18NUtil; @@ -50,7 +49,7 @@ public class RM3450Test extends BaseRMTestCase doTestInTransaction(new FailureTest ( I18NUtil.getMessage(MSG_CANNOT_CAST_TO_RM_TYPE), - InvalidParameterException.class + IntegrityException.class ) { @Override diff --git a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/FilePlanTypeUnitTest.java b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/FilePlanTypeUnitTest.java index bdad80df6e..ef08b695da 100644 --- a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/FilePlanTypeUnitTest.java +++ b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/FilePlanTypeUnitTest.java @@ -29,11 +29,11 @@ package org.alfresco.module.org_alfresco_module_rm.model.rma.type; import static org.mockito.Mockito.when; -import java.security.InvalidParameterException; import java.util.Arrays; import org.alfresco.model.ContentModel; import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest; +import org.alfresco.repo.node.integrity.IntegrityException; import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.namespace.QName; @@ -69,7 +69,7 @@ public class FilePlanTypeUnitTest extends BaseUnitTest * When adding a child of type TYPE_FILE_PLAN * Then an error should be thrown */ - @Test (expected = InvalidParameterException.class) + @Test (expected = IntegrityException.class) public void testAddFileplanToFileplan() { ChildAssociationRef childAssoc = createFileplanContainerChild(TYPE_FILE_PLAN); @@ -112,7 +112,7 @@ public class FilePlanTypeUnitTest extends BaseUnitTest * When adding another child of type TYPE_HOLD_CONTAINER * Then an error should be thrown */ - @Test (expected = InvalidParameterException.class) + @Test (expected = IntegrityException.class) public void testCreateMultipleHoldContainers() { ChildAssociationRef existingHoldAssoc = createFileplanContainerChild(TYPE_HOLD_CONTAINER); @@ -141,7 +141,7 @@ public class FilePlanTypeUnitTest extends BaseUnitTest * When adding another child of type TYPE_TRANSFER_CONTAINER * Then an error should be thrown */ - @Test (expected = InvalidParameterException.class) + @Test (expected = IntegrityException.class) public void testCreateMultipleTransferContainers() { ChildAssociationRef existingHoldAssoc = createFileplanContainerChild(TYPE_TRANSFER_CONTAINER); @@ -170,7 +170,7 @@ public class FilePlanTypeUnitTest extends BaseUnitTest * When adding another child of type TYPE_UNFILED_RECORD_CONTAINER * Then an error should be thrown */ - @Test (expected = InvalidParameterException.class) + @Test (expected = IntegrityException.class) public void testCreateMultipleUnfiledRecordsContainers() { ChildAssociationRef existingHoldAssoc = createFileplanContainerChild(TYPE_UNFILED_RECORD_CONTAINER); diff --git a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/HoldContainerTypeUnitTest.java b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/HoldContainerTypeUnitTest.java index 1a614fc075..9e414974ca 100644 --- a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/HoldContainerTypeUnitTest.java +++ b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/HoldContainerTypeUnitTest.java @@ -29,10 +29,9 @@ package org.alfresco.module.org_alfresco_module_rm.model.rma.type; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import java.security.InvalidParameterException; - import org.alfresco.module.org_alfresco_module_rm.test.util.AlfMock; import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest; +import org.alfresco.repo.node.integrity.IntegrityException; import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.namespace.QName; @@ -52,9 +51,9 @@ public class HoldContainerTypeUnitTest extends BaseUnitTest /** * Given that we try to add a non "rma:hold" type to hold container, - * Then InvalidParameterException is thrown. + * Then IntegrityException is thrown. */ - @Test (expected = InvalidParameterException.class) + @Test (expected = IntegrityException.class) public void testAddNonHoldTypeToHoldContainer() { QName type = AlfMock.generateQName(); diff --git a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteTypeUnitTest.java b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteTypeUnitTest.java index a9483509ad..5e876ffaed 100644 --- a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteTypeUnitTest.java +++ b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RmSiteTypeUnitTest.java @@ -30,7 +30,6 @@ package org.alfresco.module.org_alfresco_module_rm.model.rma.type; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import java.security.InvalidParameterException; import java.util.ArrayList; import org.alfresco.module.org_alfresco_module_rm.dod5015.DOD5015Model; @@ -38,6 +37,7 @@ import org.alfresco.module.org_alfresco_module_rm.test.util.AlfMock; import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest; import org.alfresco.module.org_alfresco_module_rm.test.util.MockAuthenticationUtilHelper; import org.alfresco.module.org_alfresco_module_rm.util.AuthenticationUtil; +import org.alfresco.repo.node.integrity.IntegrityException; import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.site.SiteInfo; @@ -77,9 +77,9 @@ public class RmSiteTypeUnitTest extends BaseUnitTest implements DOD5015Model /** * Given that we try to add non allowed type to rm site, - * Then InvalidParameterException is thrown. + * Then IntegrityException is thrown. */ - @Test(expected = InvalidParameterException.class) + @Test(expected = IntegrityException.class) public void testAddNonAcceptedTypeToRmSite() { NodeRef rmSiteNodeRef = generateNodeRef(TYPE_RM_SITE, true); @@ -149,9 +149,9 @@ public class RmSiteTypeUnitTest extends BaseUnitTest implements DOD5015Model /** * Given that we try to add more than two cm:folder to rm site, - * Then InvalidParameterException is thrown. + * Then IntegrityException is thrown. */ - @Test(expected = InvalidParameterException.class) + @Test(expected = IntegrityException.class) public void testAddMoreThanTwhoFolderTypeToRmSite() { NodeRef rmSiteNodeRef = generateNodeRef(TYPE_RM_SITE, true); @@ -208,9 +208,9 @@ public class RmSiteTypeUnitTest extends BaseUnitTest implements DOD5015Model /** * Given that we try to add one dod:filePlan to standard rm site, - * Then InvalidParameterException is thrown. + * Then IntegrityException is thrown. */ - @Test(expected = InvalidParameterException.class) + @Test(expected = IntegrityException.class) public void testAddDODFilePlanTypeToStandardRmSite() { NodeRef rmSiteNodeRef = generateNodeRef(TYPE_RM_SITE, true); @@ -225,9 +225,9 @@ public class RmSiteTypeUnitTest extends BaseUnitTest implements DOD5015Model /** * Given that we try to add more than one rma:filePlan to rm site, - * Then InvalidParameterException is thrown. + * Then IntegrityException is thrown. */ - @Test(expected = InvalidParameterException.class) + @Test(expected = IntegrityException.class) public void testAddMoreThanOneFilePlanTypeToRmSite() { NodeRef rmSiteNodeRef = generateNodeRef(TYPE_RM_SITE, true); @@ -281,9 +281,9 @@ public class RmSiteTypeUnitTest extends BaseUnitTest implements DOD5015Model /** * Given that we try to add more than one dod:filePlan to rm site, - * Then InvalidParameterException is thrown. + * Then IntegrityException is thrown. */ - @Test(expected = InvalidParameterException.class) + @Test(expected = IntegrityException.class) public void testAddMoreThanOneDODFilePlanTypeToRmSite() { NodeRef rmSiteNodeRef = generateNodeRef(TYPE_DOD_5015_SITE, true); @@ -315,9 +315,9 @@ public class RmSiteTypeUnitTest extends BaseUnitTest implements DOD5015Model /** * Given that we try to add one rma:filePlan to DOD rm site, - * Then InvalidParameterException is thrown. + * Then IntegrityException is thrown. */ - @Test(expected = InvalidParameterException.class) + @Test(expected = IntegrityException.class) public void testAddStandardFilePlanTypeToDODRmSite() { NodeRef rmSiteNodeRef = generateNodeRef(TYPE_DOD_5015_SITE, true); diff --git a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/TransferContainerTypeUnitTest.java b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/TransferContainerTypeUnitTest.java index 1623164f25..2126da6b8b 100644 --- a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/TransferContainerTypeUnitTest.java +++ b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/TransferContainerTypeUnitTest.java @@ -29,10 +29,9 @@ package org.alfresco.module.org_alfresco_module_rm.model.rma.type; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import java.security.InvalidParameterException; - import org.alfresco.module.org_alfresco_module_rm.test.util.AlfMock; import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest; +import org.alfresco.repo.node.integrity.IntegrityException; import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.namespace.QName; @@ -52,9 +51,9 @@ public class TransferContainerTypeUnitTest extends BaseUnitTest /** * Given that we try to add to transfer container, - * Then InvalidParameterException is thrown. + * Then IntegrityException is thrown. */ - @Test(expected = InvalidParameterException.class) + @Test(expected = IntegrityException.class) public void testAddToTransferContainerTest() { NodeRef transferContainer = generateNodeRef(TYPE_TRANSFER_CONTAINER, true); diff --git a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/TransferTypeUnitTest.java b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/TransferTypeUnitTest.java index d16b49759a..fe5cf4a69a 100644 --- a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/TransferTypeUnitTest.java +++ b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/TransferTypeUnitTest.java @@ -30,10 +30,9 @@ package org.alfresco.module.org_alfresco_module_rm.model.rma.type; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import java.security.InvalidParameterException; - import org.alfresco.module.org_alfresco_module_rm.test.util.AlfMock; import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest; +import org.alfresco.repo.node.integrity.IntegrityException; import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.namespace.QName; @@ -53,9 +52,9 @@ public class TransferTypeUnitTest extends BaseUnitTest /** * Given that we try to add to transfer type folder, - * Then InvalidParameterException is thrown. + * Then IntegrityException is thrown. */ - @Test(expected = InvalidParameterException.class) + @Test(expected = IntegrityException.class) public void testAddToTransferFolderTest() { NodeRef transferFolder = generateNodeRef(TYPE_TRANSFER, true); diff --git a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/UnfiledRecordContainerTypeUnitTest.java b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/UnfiledRecordContainerTypeUnitTest.java index 5ed5fc662e..6edd9c2eda 100644 --- a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/UnfiledRecordContainerTypeUnitTest.java +++ b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/UnfiledRecordContainerTypeUnitTest.java @@ -30,11 +30,10 @@ package org.alfresco.module.org_alfresco_module_rm.model.rma.type; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import java.security.InvalidParameterException; - import org.alfresco.model.ContentModel; import org.alfresco.module.org_alfresco_module_rm.test.util.AlfMock; import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest; +import org.alfresco.repo.node.integrity.IntegrityException; import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.namespace.QName; @@ -54,9 +53,9 @@ public class UnfiledRecordContainerTypeUnitTest extends BaseUnitTest /** * Given that we try to add a type that is not one of "rma:unfiledRecordFolder", "cm:content" or "rma:nonElectronicDocument" types to unfiled record container, - * Then InvalidParameterException is thrown. + * Then IntegrityException is thrown. */ - @Test(expected = InvalidParameterException.class) + @Test(expected = IntegrityException.class) public void testAddNonAcceptedTypeToUnfiledRecordContainer() { QName type = AlfMock.generateQName(); diff --git a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/UnfiledRecordFolderTypeUnitTest.java b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/UnfiledRecordFolderTypeUnitTest.java index 18efc7ecde..34f5411031 100644 --- a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/UnfiledRecordFolderTypeUnitTest.java +++ b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/UnfiledRecordFolderTypeUnitTest.java @@ -30,11 +30,10 @@ package org.alfresco.module.org_alfresco_module_rm.model.rma.type; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import java.security.InvalidParameterException; - import org.alfresco.model.ContentModel; import org.alfresco.module.org_alfresco_module_rm.test.util.AlfMock; import org.alfresco.module.org_alfresco_module_rm.test.util.BaseUnitTest; +import org.alfresco.repo.node.integrity.IntegrityException; import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.namespace.QName; @@ -54,9 +53,9 @@ public class UnfiledRecordFolderTypeUnitTest extends BaseUnitTest /** * Given that we try to add a type that is not one of "rma:unfiledRecordFolder", "cm:content" or "rma:nonElectronicDocument" types to unfiled record folder, - * Then InvalidParameterException is thrown. + * Then IntegrityException is thrown. */ - @Test(expected = InvalidParameterException.class) + @Test(expected = IntegrityException.class) public void testAddNonAcceptedTypeToUnfiledRecordFolder() { QName type = AlfMock.generateQName();