use of org.springframework.webflow.test.MockExternalContext in project head by mifos.
the class CreateSavingsAccountTest method testSelectProductOfferingStep_Cancel.
@Test
public void testSelectProductOfferingStep_Cancel() {
setCurrentState("selectProductOfferingStep");
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 testPreviewStep_SaveForApproved.
@Test
public void testPreviewStep_SaveForApproved() {
setCurrentState("previewStep");
MockExternalContext context = new MockExternalContext();
context.setEventId("approve");
resumeFlow(context);
verify(controller).createAccountInActiveState(formBean);
assertFlowExecutionEnded();
assertFlowExecutionOutcomeEquals("complete");
}
use of org.springframework.webflow.test.MockExternalContext in project head by mifos.
the class CreateSavingsAccountTest method testEnterAccountDetailsStep_DetailsEntered_NoQuestionGroup.
/**
* Account info entry step is complete. There is NO question group defined
* for "Create Savings" work flow.
*/
@Test
public void testEnterAccountDetailsStep_DetailsEntered_NoQuestionGroup() {
List<QuestionGroupDetail> groups = new ArrayList<QuestionGroupDetail>();
when(formBean.getQuestionGroups()).thenReturn(groups);
setCurrentState("enterAccountDetailsStep");
MockExternalContext context = new MockExternalContext();
context.setEventId("detailsEntered");
resumeFlow(context);
assertCurrentStateEquals("previewStep");
}
use of org.springframework.webflow.test.MockExternalContext in project head by mifos.
the class CreateSavingsAccountTest method testSelectCustomerStep_CustomerSelected.
@Test
public void testSelectCustomerStep_CustomerSelected() {
Integer customerId = 1;
setCurrentState("selectCustomerStep");
doNothing().when(controller).getProductOfferings(formBean);
MockExternalContext context = new MockExternalContext();
MockParameterMap requestParameterMap = new MockParameterMap();
requestParameterMap.put("customerId", customerId.toString());
context.setRequestParameterMap(requestParameterMap);
context.setEventId("customerSelected");
resumeFlow(context);
verify(controller).customerSelected(customerId, formBean);
verify(controller).getProductOfferings(formBean);
assertCurrentStateEquals("selectProductOfferingStep");
}
use of org.springframework.webflow.test.MockExternalContext in project head by mifos.
the class CreateSavingsAccountTest method testPreviewStep_Cancel.
@Test
public void testPreviewStep_Cancel() {
setCurrentState("previewStep");
MockExternalContext context = new MockExternalContext();
context.setEventId("cancel");
resumeFlow(context);
assertFlowExecutionEnded();
}
Aggregations