use of org.mifos.test.acceptance.framework.questionnaire.AttachQuestionGroupParameters in project head by mifos.
the class QuestionGroupSavingsAccountTest method verifyAttachingQuestionGroupToSavingsAccount.
/**
* Attaching a Question Group to a Savings Account and capturing responses
* http://mifosforge.jira.com/browse/MIFOSTEST-659
*
* @throws Exception
*/
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyAttachingQuestionGroupToSavingsAccount() throws Exception {
//Given
questionGroupTestHelper.markQuestionGroupAsActive("QGForViewSavings");
try {
AttachQuestionGroupParameters attachParams = new AttachQuestionGroupParameters();
attachParams.setTarget("000100000000059");
attachParams.setQuestionGroupName("QGForViewSavings");
attachParams.addTextResponse("DateQuestion", "09/02/2011");
attachParams.addTextResponse("Number", "10");
attachParams.addTextResponse("NumberBetween5And10", "6");
AttachQuestionGroupParameters attachErrorParams = new AttachQuestionGroupParameters();
attachErrorParams.setTarget("000100000000059");
attachErrorParams.setQuestionGroupName("QGForViewSavings");
attachErrorParams.addTextResponse("Number", "qwerty");
attachErrorParams.addTextResponse("NumberBetween5And10", "qwerty");
attachErrorParams.addError("Please specify DateQuestion");
attachErrorParams.addError("Please specify a number for Number");
attachErrorParams.addError("Please specify a number between 5 and 10 for NumberBetween5And10");
//When
questionGroupTestHelper.verifyErrorsWhileAttachingQuestionGroupToSavingsAccount(attachErrorParams);
questionGroupTestHelper.attachQuestionGroupToSavingsAccount(attachParams);
attachParams.addTextResponse("Number", "15");
attachParams.addTextResponse("NumberBetween5And10", "10");
//Then
questionGroupTestHelper.editQuestionGroupResponsesInSavingsAccount(attachParams);
} finally {
questionGroupTestHelper.markQuestionGroupAsInactive("QGForViewSavings");
}
}
Aggregations