use of easytests.core.entities.IssueStandardQuestionTypeOptionEntity in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsMapperTest method testDelete.
@Test
public void testDelete() throws Exception {
Integer id = 1;
IssueStandardQuestionTypeOptionEntity questionTypeOptionEntity = this.questionTypeOptionMapper.find(id);
Assert.assertNotNull(questionTypeOptionEntity);
this.questionTypeOptionMapper.delete(questionTypeOptionEntity);
questionTypeOptionEntity = this.questionTypeOptionMapper.find(id);
Assert.assertNull(questionTypeOptionEntity);
}
use of easytests.core.entities.IssueStandardQuestionTypeOptionEntity in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsService method map.
private IssueStandardQuestionTypeOptionEntity map(IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel) {
final IssueStandardQuestionTypeOptionEntity questionTypeOptionEntity = new IssueStandardQuestionTypeOptionEntity();
questionTypeOptionEntity.map(questionTypeOptionModel);
return questionTypeOptionEntity;
}
use of easytests.core.entities.IssueStandardQuestionTypeOptionEntity in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testSaveCreatesEntity.
@Test
public void testSaveCreatesEntity() throws Exception {
final ArgumentCaptor<IssueStandardQuestionTypeOptionEntity> questionTypeOptionEntityCaptor = ArgumentCaptor.forClass(IssueStandardQuestionTypeOptionEntity.class);
final IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel = this.questionTypeOptionsSupport.getModelAdditionalMock(0);
this.questionTypeOptionsService.save(questionTypeOptionModel);
verify(this.questionTypeOptionsMapper, times(1)).insert(questionTypeOptionEntityCaptor.capture());
this.questionTypeOptionsSupport.assertEquals(this.questionTypeOptionsSupport.getEntityAdditionalMock(0), questionTypeOptionEntityCaptor.getValue());
}
use of easytests.core.entities.IssueStandardQuestionTypeOptionEntity in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testSaveUpdateEntityIdOnCreation.
@Test
public void testSaveUpdateEntityIdOnCreation() throws Exception {
final Integer id = 10;
final IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel = this.questionTypeOptionsSupport.getModelAdditionalMock(0);
doAnswer(invocations -> {
final IssueStandardQuestionTypeOptionEntity questionTypeOptionEntity = (IssueStandardQuestionTypeOptionEntity) invocations.getArguments()[0];
questionTypeOptionEntity.setId(id);
return null;
}).when(this.questionTypeOptionsMapper).insert(any());
this.questionTypeOptionsService.save(questionTypeOptionModel);
verify(questionTypeOptionModel, times(1)).setId(id);
}
use of easytests.core.entities.IssueStandardQuestionTypeOptionEntity in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsSupport method getEntityMock.
private IssueStandardQuestionTypeOptionEntity getEntityMock(Integer id, Integer questionType, Integer minQuestions, Integer maxQuestions, Integer timeLimit, Integer issueStandardId) {
final IssueStandardQuestionTypeOptionEntity issueStandardQuestionTypeOptionEntity = Mockito.mock(IssueStandardQuestionTypeOptionEntity.class);
Mockito.when(issueStandardQuestionTypeOptionEntity.getId()).thenReturn(id);
Mockito.when(issueStandardQuestionTypeOptionEntity.getQuestionTypeId()).thenReturn(questionType);
Mockito.when(issueStandardQuestionTypeOptionEntity.getMinQuestions()).thenReturn(minQuestions);
Mockito.when(issueStandardQuestionTypeOptionEntity.getMaxQuestions()).thenReturn(maxQuestions);
Mockito.when(issueStandardQuestionTypeOptionEntity.getTimeLimit()).thenReturn(timeLimit);
Mockito.when(issueStandardQuestionTypeOptionEntity.getIssueStandardId()).thenReturn(issueStandardId);
return issueStandardQuestionTypeOptionEntity;
}
Aggregations