use of org.springframework.webflow.test.MockExternalContext in project head by mifos.
the class CreateSavingsAccountTest method testAnswerQuestionGroupStep_Cancel.
@Test
public void testAnswerQuestionGroupStep_Cancel() {
setCurrentState("answerQuestionGroupStep");
MockExternalContext context = new MockExternalContext();
context.setEventId("cancel");
resumeFlow(context);
assertFlowExecutionEnded();
}
use of org.springframework.webflow.test.MockExternalContext in project head by mifos.
the class CreateSavingsAccountTest method testSelectCustomerStep_SearchTermEntered.
@Test
public void testSelectCustomerStep_SearchTermEntered() {
setCurrentState("selectCustomerStep");
MockExternalContext context = new MockExternalContext();
context.setEventId("searchTermEntered");
resumeFlow(context);
verify(controller).searchCustomers(formBean);
assertCurrentStateEquals("selectCustomerStep");
}
use of org.springframework.webflow.test.MockExternalContext in project head by mifos.
the class CreateSavingsAccountTest method testStartFlow_CustomerIdNotProvided.
@Test
public void testStartFlow_CustomerIdNotProvided() {
MutableAttributeMap input = new LocalAttributeMap();
MockExternalContext context = new MockExternalContext();
startFlow(input, context);
assertCurrentStateEquals("customerSearchStep");
}
use of org.springframework.webflow.test.MockExternalContext in project head by mifos.
the class CreateSavingsAccountTest method testEnterAccountDetailsStep_NewProductSelected.
@Test
public void testEnterAccountDetailsStep_NewProductSelected() {
Integer productId = 1;
setCurrentState("enterAccountDetailsStep");
MockExternalContext context = new MockExternalContext();
MockParameterMap requestParameterMap = new MockParameterMap();
requestParameterMap.put("productId", productId.toString());
context.setRequestParameterMap(requestParameterMap);
context.setEventId("newProductSelected");
resumeFlow(context);
verify(controller).loadProduct(productId, formBean);
assertCurrentStateEquals("enterAccountDetailsStep");
}
use of org.springframework.webflow.test.MockExternalContext in project head by mifos.
the class CreateSavingsAccountTest method testEnterAccountDetailsStep_DetailsEntered_WithQuestionGroup.
/**
* Account info entry step is complete. There is a question group defined
* for "Create Savings" work flow.
*/
@Test
public void testEnterAccountDetailsStep_DetailsEntered_WithQuestionGroup() {
List<QuestionGroupDetail> groups = new ArrayList<QuestionGroupDetail>();
groups.add(new QuestionGroupDetail());
when(formBean.getQuestionGroups()).thenReturn(groups);
setCurrentState("enterAccountDetailsStep");
MockExternalContext context = new MockExternalContext();
context.setEventId("detailsEntered");
resumeFlow(context);
assertCurrentStateEquals("answerQuestionGroupStep");
}
Aggregations