use of org.mifos.platform.questionnaire.service.dtos.QuestionGroupResponseDto in project head by mifos.
the class QuestionnaireMapperTest method getQuestionGroupInstanceDto.
private QuestionGroupInstanceDto getQuestionGroupInstanceDto() {
QuestionGroupInstanceDtoBuilder instanceBuilder = new QuestionGroupInstanceDtoBuilder();
QuestionGroupResponseDtoBuilder responseBuilder = new QuestionGroupResponseDtoBuilder();
responseBuilder.withResponse("Answer1").withSectionQuestion(999);
QuestionGroupResponseDto questionGroupResponseDto = responseBuilder.build();
instanceBuilder.withQuestionGroup(123).withCompleted(true).withCreator(111).withEventSource(1).withEntity(12345).withVersion(1).addResponses(questionGroupResponseDto);
return instanceBuilder.build();
}
use of org.mifos.platform.questionnaire.service.dtos.QuestionGroupResponseDto in project head by mifos.
the class QuestionnaireServiceTest method shouldSaveQuestionGroupInstance.
@Test
public void shouldSaveQuestionGroupInstance() {
QuestionGroupInstanceDtoBuilder instanceBuilder = new QuestionGroupInstanceDtoBuilder();
QuestionGroupResponseDtoBuilder responseBuilder = new QuestionGroupResponseDtoBuilder();
responseBuilder.withResponse("Answer1").withSectionQuestion(999);
QuestionGroupResponseDto questionGroupResponseDto = responseBuilder.build();
instanceBuilder.withQuestionGroup(123).withCompleted(true).withCreator(111).withEventSource(1).withEntity(12345).withVersion(1).addResponses(questionGroupResponseDto);
QuestionGroupInstanceDto questionGroupInstanceDto = instanceBuilder.build();
when(questionGroupInstanceDao.create(Matchers.<QuestionGroupInstance>any())).thenReturn(789);
Integer qgInstanceId = questionnaireService.saveQuestionGroupInstance(questionGroupInstanceDto);
assertThat(qgInstanceId, is(789));
verify(questionGroupInstanceDao).create(any(QuestionGroupInstance.class));
}
use of org.mifos.platform.questionnaire.service.dtos.QuestionGroupResponseDto in project head by mifos.
the class QuestionnaireServiceIntegrationTest method getQuestionGroupInstanceDto.
private QuestionGroupInstanceDto getQuestionGroupInstanceDto(String response, Integer creatorId, Integer entityId, Integer questionGroupId, Integer sectionQuestionId) {
QuestionGroupInstanceDtoBuilder instanceBuilder = new QuestionGroupInstanceDtoBuilder();
QuestionGroupResponseDtoBuilder responseBuilder = new QuestionGroupResponseDtoBuilder();
responseBuilder.withResponse(response).withSectionQuestion(sectionQuestionId);
QuestionGroupResponseDto questionGroupResponseDto = responseBuilder.build();
instanceBuilder.withQuestionGroup(questionGroupId).withCompleted(true).withCreator(creatorId).withEventSource(1).withEntity(entityId).withVersion(1).addResponses(questionGroupResponseDto);
return instanceBuilder.build();
}
Aggregations