Class WorkflowTest
- java.lang.Object
-
- de.hybris.platform.testframework.HybrisJUnit4Test
-
- de.hybris.platform.servicelayer.ServicelayerBaseTest
-
- de.hybris.platform.servicelayer.ServicelayerTransactionalBaseTest
-
- de.hybris.platform.workflow.integration.WorkflowTest
-
- All Implemented Interfaces:
JaloSessionHolder
- Direct Known Subclasses:
WorkflowAutomatedTest
,WorkflowBasicTest
,WorkflowIterationTest
@DemoTest public class WorkflowTest extends ServicelayerTransactionalBaseTest
Test for extension Workflow.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
WorkflowTest.ACTIONCODES
protected static class
WorkflowTest.DECISIONCODES
-
Field Summary
Fields Modifier and Type Field Description protected CatalogVersionService
catalogVersionService
protected FlexibleSearchService
flexibleSearchService
protected ModelService
modelService
protected WorkflowTemplateModel
testTemplate
Template instance created at each set up.protected WorkflowModel
testWorkflow
workflow instance created at each set up.protected TypeService
typeService
protected UserService
userService
protected WorkflowActionService
workflowActionService
protected WorkflowAttachmentService
workflowAttachmentService
protected WorkflowProcessingService
workflowProcessingService
protected WorkflowService
workflowService
Reference to the manager instance.-
Fields inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
jaloSession
-
-
Constructor Summary
Constructors Constructor Description WorkflowTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
clearCache()
protected AutomatedWorkflowActionTemplateModel
createAutomatedWorkflowActionTemplateModel(UserModel user, java.lang.String code, WorkflowActionType actionType, WorkflowTemplateModel workflow, java.lang.Class jobClass)
Creates new automated action template.protected UserModel
createUser(java.lang.String userName)
Creates a user instance using given uid.protected WorkflowActionTemplateModel
createWorkflowActionTemplateModel(UserModel user, java.lang.String code, WorkflowActionType actionType, WorkflowTemplateModel workflow)
Creates new action template.protected void
createWorkflowActionTemplateModelLinkTemplateRelation(WorkflowDecisionTemplateModel decisionTemplate, WorkflowActionTemplateModel toAction, java.lang.Boolean hasAndConnection)
protected WorkflowDecisionTemplateModel
createWorkflowDecisionTemplate(java.lang.String code, WorkflowActionTemplateModel actionTemplate)
Creates new decision template.protected WorkflowTemplateModel
createWorkflowTemplate(UserModel user)
Creates a workflow template with given user assigned.protected WorkflowTemplateModel
createWorkflowTemplate(UserModel owner, java.lang.String code, java.lang.String desc)
Creates new workflow template using given user, code, and description.protected WorkflowTemplateModel
createWorkflowTemplate(UserModel owner, java.lang.String code, java.lang.String desc, java.lang.String activationScript)
Creates new workflow template using given user, code, description and activation script.protected WorkflowActionModel
getAction(java.lang.String code)
Gets the action with given code from test workflow instance.protected WorkflowActionTemplateModel
getActionTemplate(java.lang.String code)
Gets the action template with given code from test workflow template.protected WorkflowDecisionModel
getDecision(java.lang.String code, WorkflowActionModel action)
Gets the decision with given code from test workflow instance.void
setUp()
void
testActionsSize()
check actions sizevoid
testTemplateActionsSize()
check actions template size-
Methods inherited from class de.hybris.platform.servicelayer.ServicelayerBaseTest
autowireProperties, getApplicationContext, getBeanName, prepareApplicationContextAndSession
-
Methods inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
establishJaloSession, finish, getOrCreateCurrency, getOrCreateLanguage, init, intenseChecksActivated, takeJaloSession
-
-
-
-
Field Detail
-
workflowService
protected WorkflowService workflowService
Reference to the manager instance.
-
modelService
protected ModelService modelService
-
userService
protected UserService userService
-
typeService
protected TypeService typeService
-
flexibleSearchService
protected FlexibleSearchService flexibleSearchService
-
catalogVersionService
protected CatalogVersionService catalogVersionService
-
workflowActionService
protected WorkflowActionService workflowActionService
-
workflowProcessingService
protected WorkflowProcessingService workflowProcessingService
-
workflowAttachmentService
protected WorkflowAttachmentService workflowAttachmentService
-
testTemplate
protected WorkflowTemplateModel testTemplate
Template instance created at each set up.
-
testWorkflow
protected WorkflowModel testWorkflow
workflow instance created at each set up.
-
-
Method Detail
-
setUp
public void setUp() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testTemplateActionsSize
public void testTemplateActionsSize()
check actions template size
-
testActionsSize
public void testActionsSize()
check actions size
-
createWorkflowTemplate
protected WorkflowTemplateModel createWorkflowTemplate(UserModel user)
Creates a workflow template with given user assigned.- Parameters:
user
- user instance to use for template- Returns:
- new created template instance
-
createUser
protected UserModel createUser(java.lang.String userName)
Creates a user instance using given uid.- Parameters:
userName
- user id used for user creation- Returns:
- created user
-
clearCache
protected void clearCache()
-
createWorkflowTemplate
protected WorkflowTemplateModel createWorkflowTemplate(UserModel owner, java.lang.String code, java.lang.String desc)
Creates new workflow template using given user, code, and description.- Parameters:
owner
- user assigned to new templatecode
- code of new templatedesc
- description assigned to template- Returns:
- created template
-
createWorkflowTemplate
protected WorkflowTemplateModel createWorkflowTemplate(UserModel owner, java.lang.String code, java.lang.String desc, java.lang.String activationScript)
Creates new workflow template using given user, code, description and activation script.- Parameters:
owner
- user assigned to new templatecode
- code of new templatedesc
- description assigned to templateactivationScript
- code of the activation script- Returns:
- created template
-
createWorkflowActionTemplateModel
protected WorkflowActionTemplateModel createWorkflowActionTemplateModel(UserModel user, java.lang.String code, WorkflowActionType actionType, WorkflowTemplateModel workflow)
Creates new action template.- Parameters:
user
- user assigned to templatecode
- code of templateworkflow
- workflow assigned to action template- Returns:
- created action template
-
createAutomatedWorkflowActionTemplateModel
protected AutomatedWorkflowActionTemplateModel createAutomatedWorkflowActionTemplateModel(UserModel user, java.lang.String code, WorkflowActionType actionType, WorkflowTemplateModel workflow, java.lang.Class jobClass)
Creates new automated action template.- Parameters:
user
- user assigned to templatecode
- code of templateworkflow
- workflow assigned to action template- Returns:
- created action template
-
createWorkflowDecisionTemplate
protected WorkflowDecisionTemplateModel createWorkflowDecisionTemplate(java.lang.String code, WorkflowActionTemplateModel actionTemplate)
Creates new decision template.- Parameters:
code
- code of templateactionTemplate
- action template assigned to decision template- Returns:
- created decision template
-
createWorkflowActionTemplateModelLinkTemplateRelation
protected void createWorkflowActionTemplateModelLinkTemplateRelation(WorkflowDecisionTemplateModel decisionTemplate, WorkflowActionTemplateModel toAction, java.lang.Boolean hasAndConnection)
- Parameters:
decisionTemplate
-toAction
-hasAndConnection
-
-
getAction
protected WorkflowActionModel getAction(java.lang.String code)
Gets the action with given code from test workflow instance.- Parameters:
code
- code of needed action- Returns:
- action of test workflow with given code
-
getDecision
protected WorkflowDecisionModel getDecision(java.lang.String code, WorkflowActionModel action)
Gets the decision with given code from test workflow instance.- Parameters:
code
- code of needed decision- Returns:
- decision of test workflow with given code
-
getActionTemplate
protected WorkflowActionTemplateModel getActionTemplate(java.lang.String code)
Gets the action template with given code from test workflow template.- Parameters:
code
- code of needed action- Returns:
- action template of test workflow template with given code
-
-