use of org.mifos.platform.questionnaire.service.QuestionGroupDetail in project head by mifos.
the class SectionQuestionDaoIntegrationTest method shouldRetrieveSectionQuestionIdByQuestionGroupNameSectionNameQuestionId.
@Test
@Transactional(rollbackFor = DataAccessException.class)
public void shouldRetrieveSectionQuestionIdByQuestionGroupNameSectionNameQuestionId() {
String title = "QG1" + currentTimeMillis();
SectionDetail sectionDetail1 = getSection("S1");
SectionDetail sectionDetail2 = getSection("S2");
List<SectionDetail> details = asList(sectionDetail1, sectionDetail2);
QuestionGroupDetail questionGroupDetail = defineQuestionGroup(title, "Create", "Client", details, false);
QuestionGroup questionGroup = questionGroupDao.getDetails(questionGroupDetail.getId());
Integer questionId = questionGroup.getSections().get(1).getQuestions().get(1).getQuestion().getQuestionId();
Integer sectionQuestionId = questionGroup.getSections().get(1).getQuestions().get(1).getId();
List<Integer> sectionQuestionIds = sectionQuestionDao.retrieveIdFromQuestionGroupIdQuestionIdSectionName("S2", questionId, questionGroup.getId());
assertThat(sectionQuestionIds, is(notNullValue()));
assertThat(sectionQuestionIds.size(), is(1));
assertThat(sectionQuestionIds.get(0), is(sectionQuestionId));
}
use of org.mifos.platform.questionnaire.service.QuestionGroupDetail in project head by mifos.
the class SavingsAccountActionTest method getQuestionGroupDetail.
private QuestionGroupDetail getQuestionGroupDetail(String title, List<String> answerChoices) {
QuestionGroupDetail questionGroupDetail = new QuestionGroupDetail();
questionGroupDetail.setTitle(title);
questionGroupDetail.setId(123);
questionGroupDetail.setSectionDetails(asList(getSectionDetail("Section1", "Question1", answerChoices)));
return questionGroupDetail;
}
use of org.mifos.platform.questionnaire.service.QuestionGroupDetail in project head by mifos.
the class CenterCustActionTest method getQuestionGroupDetail.
private QuestionGroupDetail getQuestionGroupDetail(String title, List<String> answerChoices) {
QuestionGroupDetail questionGroupDetail = new QuestionGroupDetail();
questionGroupDetail.setTitle(title);
questionGroupDetail.setId(123);
questionGroupDetail.setSectionDetails(asList(getSectionDetail("Section1", "Question1", answerChoices)));
return questionGroupDetail;
}
use of org.mifos.platform.questionnaire.service.QuestionGroupDetail in project head by mifos.
the class IntegrationTestObjectMother method createClientLoan.
public static LoanBO createClientLoan(CreateLoanAccount createLoanAccount) {
List<QuestionGroupDetail> questionGroups = new ArrayList<QuestionGroupDetail>();
LoanAccountCashFlow loanAccountCashFlow = null;
LoanCreationResultDto result = loanAccountServiceFacade.createLoan(createLoanAccount, questionGroups, loanAccountCashFlow);
return loanDao.findByGlobalAccountNum(result.getGlobalAccountNum());
}
Aggregations