Class DefaultCMSWorkflowFacadeTest

java.lang.Object
de.hybris.platform.cmsfacades.workflow.impl.DefaultCMSWorkflowFacadeTest

@UnitTest public class DefaultCMSWorkflowFacadeTest extends Object
  • Constructor Details

    • DefaultCMSWorkflowFacadeTest

      public DefaultCMSWorkflowFacadeTest()
  • Method Details

    • setUp

      public void setUp() throws CMSItemNotFoundException
      Throws:
      CMSItemNotFoundException
    • givenUserHasNoCreatePermissionOnWorkflow_WhenCreateAndStartWorkflowCalled_ThenItThrowsAnException

      public void givenUserHasNoCreatePermissionOnWorkflow_WhenCreateAndStartWorkflowCalled_ThenItThrowsAnException() throws CMSItemNotFoundException
      Throws:
      CMSItemNotFoundException
    • givenInvalidPayload_WhenCreateAndStartWorkflowCalled_ThenItMustThrowValidationError

      public void givenInvalidPayload_WhenCreateAndStartWorkflowCalled_ThenItMustThrowValidationError() throws CMSItemNotFoundException
      Throws:
      CMSItemNotFoundException
    • givenValidPayload_WhenCreateAndStartWorkflowCalled_ThenItMustCreateAndStartWorkflow

      public void givenValidPayload_WhenCreateAndStartWorkflowCalled_ThenItMustCreateAndStartWorkflow() throws CMSItemNotFoundException
      Throws:
      CMSItemNotFoundException
    • givenValidPayload_WhenCreateAndStartWorkflowCalled_ThenItMustConvertAndReturnTheRightResponsePayload

      public void givenValidPayload_WhenCreateAndStartWorkflowCalled_ThenItMustConvertAndReturnTheRightResponsePayload() throws CMSItemNotFoundException
      Throws:
      CMSItemNotFoundException
    • givenValidPayload_WhenCreateAndStartWorkflowCalled_ThenItMustSetApprovalStatusOfPageAttachemntsToCheck

      public void givenValidPayload_WhenCreateAndStartWorkflowCalled_ThenItMustSetApprovalStatusOfPageAttachemntsToCheck()
    • givenCreateVersionFlagIsFalse_WhenCreateAndStartWorkflowCalled_ThenNoVersionIsCreated

      public void givenCreateVersionFlagIsFalse_WhenCreateAndStartWorkflowCalled_ThenNoVersionIsCreated() throws CMSItemNotFoundException
      Throws:
      CMSItemNotFoundException
    • givenCreateVersionFlagIsTrue_WhenCreateAndStartWorkflowCalled_ThenItMustGenerateANewVersionForEachAttachment

      public void givenCreateVersionFlagIsTrue_WhenCreateAndStartWorkflowCalled_ThenItMustGenerateANewVersionForEachAttachment() throws CMSItemNotFoundException
      Throws:
      CMSItemNotFoundException
    • givenWorkflowCannotBeStarted_WhenCreateAndStartWorkflowIsCalled_ThenItMustThrowAnException

      public void givenWorkflowCannotBeStarted_WhenCreateAndStartWorkflowIsCalled_ThenItMustThrowAnException() throws CMSItemNotFoundException
      Throws:
      CMSItemNotFoundException
    • givenEmptyWorkFlowOperationObjectWhenPerformOperationIsCalledThenWillThrowException

      public void givenEmptyWorkFlowOperationObjectWhenPerformOperationIsCalledThenWillThrowException() throws ItemNotFoundException
      Throws:
      ItemNotFoundException
    • givenInvalidWorkflowCode_WhenPerformOperationIsCalled_ThenWillThrowException

      public void givenInvalidWorkflowCode_WhenPerformOperationIsCalled_ThenWillThrowException() throws ItemNotFoundException
      Throws:
      ItemNotFoundException
    • givenUserHasNoPermissionOnWorkflow_WhenPerformCancelOperationIsCalledThen_WillThrowException

      public void givenUserHasNoPermissionOnWorkflow_WhenPerformCancelOperationIsCalledThen_WillThrowException() throws ItemNotFoundException
      Throws:
      ItemNotFoundException
    • givenAWorkflowForCode_WhenPerformCancelWorkflowIsCalled_ThenItMustCancelTheWorkflow

      public void givenAWorkflowForCode_WhenPerformCancelWorkflowIsCalled_ThenItMustCancelTheWorkflow() throws ItemNotFoundException
      Throws:
      ItemNotFoundException
    • givenAWorkflowForCodeAndUserHasNoPermissionOnWorkflowStatusAttribute_WhenPerformCancelWorkflowIsCalled_ThenItMustThrowException

      public void givenAWorkflowForCodeAndUserHasNoPermissionOnWorkflowStatusAttribute_WhenPerformCancelWorkflowIsCalled_ThenItMustThrowException()
    • givenUserHasNoChangePermissionOnWorkflow_WhenPerformMakeDecision_ThenWillThrowException

      public void givenUserHasNoChangePermissionOnWorkflow_WhenPerformMakeDecision_ThenWillThrowException()
    • givenWorkflowForCode_WhenPerformMakeDecision_ThenItMustMakeDecision

      public void givenWorkflowForCode_WhenPerformMakeDecision_ThenItMustMakeDecision()
    • givenRequestToMakeDecisionWithVersion_WhenPerformMakeDecision_ThenVersionIsCreated

      public void givenRequestToMakeDecisionWithVersion_WhenPerformMakeDecision_ThenVersionIsCreated()
    • givenDecisionWithTwoTargetActions_WhenPerformMakeDecisionIsCalled_ThenACommentIsAttachedToTheIncomingAndTargetActions

      public void givenDecisionWithTwoTargetActions_WhenPerformMakeDecisionIsCalled_ThenACommentIsAttachedToTheIncomingAndTargetActions()
    • shouldFindNextActionForNonAutomatedAction

      public void shouldFindNextActionForNonAutomatedAction()
    • shouldFindNextActionForAutomatedAction

      public void shouldFindNextActionForAutomatedAction()
    • shouldFindNextActionForConsecutiveAutomatedActions

      public void shouldFindNextActionForConsecutiveAutomatedActions()
    • shouldFailFindAllWorkflowsNoReadTypePermission

      public void shouldFailFindAllWorkflowsNoReadTypePermission()
    • shouldFailFindAllWorkflowsValidationError

      public void shouldFailFindAllWorkflowsValidationError()
    • shouldPassFindAllWorkflows

      public void shouldPassFindAllWorkflows()
    • givenUserHasNoChangePermissionOnWorkflow_WhenEditWorkflowCalled_ThenItThrowsAnException

      public void givenUserHasNoChangePermissionOnWorkflow_WhenEditWorkflowCalled_ThenItThrowsAnException() throws ItemNotFoundException
      Throws:
      ItemNotFoundException
    • givenWorkflowDataHasValidationError_WhenEditWorkflowCalled_ThenItThrowsAnException

      public void givenWorkflowDataHasValidationError_WhenEditWorkflowCalled_ThenItThrowsAnException() throws ItemNotFoundException
      Throws:
      ItemNotFoundException
    • givenWorkflowDataHasOnlyDescription_WhenEditWorkflowCalled_ThenDescriptionIsUpdated

      public void givenWorkflowDataHasOnlyDescription_WhenEditWorkflowCalled_ThenDescriptionIsUpdated() throws ItemNotFoundException
      Throws:
      ItemNotFoundException
    • givenWorkflowDataHasDescriptionAndUserDoesNotHaveAttributePermission_WhenEditWorkflowCalled_ThenDescriptionIsNotUpdated

      public void givenWorkflowDataHasDescriptionAndUserDoesNotHaveAttributePermission_WhenEditWorkflowCalled_ThenDescriptionIsNotUpdated()
    • givenWorkflowDataHasAttachmentsAndUserDoesNotHaveAttributePermission_WhenEditWorkflowCalled_ThenAttachmentsAttributeIsNotUpdated

      public void givenWorkflowDataHasAttachmentsAndUserDoesNotHaveAttributePermission_WhenEditWorkflowCalled_ThenAttachmentsAttributeIsNotUpdated()
    • givenWorkflowDataHasAttachments_WhenEditWorkflowCalled_ThenAttachmentsAreUpdated

      public void givenWorkflowDataHasAttachments_WhenEditWorkflowCalled_ThenAttachmentsAreUpdated() throws ItemNotFoundException
      Throws:
      ItemNotFoundException
    • givenWorkflowForCode_WhenGetWorkflowForCodeIsCalled_ThenWorkflowIsReturned

      public void givenWorkflowForCode_WhenGetWorkflowForCodeIsCalled_ThenWorkflowIsReturned() throws ItemNotFoundException
      Throws:
      ItemNotFoundException
    • shouldThrowExceptionIfUidDoesNotExistWhileVerifyingWhetherItemsEditableOrNot

      public void shouldThrowExceptionIfUidDoesNotExistWhileVerifyingWhetherItemsEditableOrNot() throws CMSItemNotFoundException
      Throws:
      CMSItemNotFoundException
    • shouldReturnFirstItemIsEditableAndFalseForSecondWhenGetItemsEditableByCurrentUserIsCalled

      public void shouldReturnFirstItemIsEditableAndFalseForSecondWhenGetItemsEditableByCurrentUserIsCalled()
    • getEditableItemByUid

      protected CMSWorkflowEditableItemData getEditableItemByUid(List<CMSWorkflowEditableItemData> editableItems, String itemUid)
    • assertActionHasComment

      protected void assertActionHasComment(WorkflowActionModel actionModel, CommentModel expectedComment)