use of org.springframework.webflow.test.MockExternalContext in project head by mifos.
the class CreateSavingsAccountTest method testPreviewStep_SaveForLater.
@Test
public void testPreviewStep_SaveForLater() {
setCurrentState("previewStep");
MockExternalContext context = new MockExternalContext();
context.setEventId("saveForLater");
resumeFlow(context);
verify(controller).createAccountInPartialApplicationState(formBean);
assertFlowExecutionEnded();
assertFlowExecutionOutcomeEquals("complete");
}
use of org.springframework.webflow.test.MockExternalContext in project head by mifos.
the class CreateSavingsAccountTest method testCustomerSearchStep_SearchTermEntered.
@Test
public void testCustomerSearchStep_SearchTermEntered() {
setCurrentState("customerSearchStep");
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 testPreviewStep_EditQuestionGroup.
@Test
public void testPreviewStep_EditQuestionGroup() {
setCurrentState("previewStep");
MockExternalContext context = new MockExternalContext();
context.setEventId("editQuestionGroup");
resumeFlow(context);
verify(controller, never()).loadQuestionGroups(formBean);
assertCurrentStateEquals("editQuestionGroupStep");
}
use of org.springframework.webflow.test.MockExternalContext in project head by mifos.
the class CreateSavingsAccountTest method testStartFlow_CustomerIdProvided.
@Test
public void testStartFlow_CustomerIdProvided() {
Integer customerId = 1;
MutableAttributeMap input = new LocalAttributeMap();
MockParameterMap requestParameterMap = new MockParameterMap();
requestParameterMap.put("customerId", customerId.toString());
MockExternalContext context = new MockExternalContext();
context.setRequestParameterMap(requestParameterMap);
startFlow(input, context);
assertCurrentStateEquals("selectProductOfferingStep");
verify(controller).customerSelected(eq(customerId), any(CreateSavingsAccountFormBean.class));
verify(controller).getProductOfferings(any(CreateSavingsAccountFormBean.class));
}
use of org.springframework.webflow.test.MockExternalContext in project head by mifos.
the class CreateSavingsAccountTest method testEnterAccountDetailsStep_Cancel.
@Test
public void testEnterAccountDetailsStep_Cancel() {
setCurrentState("enterAccountDetailsStep");
MockExternalContext context = new MockExternalContext();
context.setEventId("cancel");
resumeFlow(context);
assertFlowExecutionEnded();
}
Aggregations