use of easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testDeleteListWithOptions.
@Test
public void testDeleteListWithOptions() throws Exception {
final IssueStandardQuestionTypeOptionsOptionsInterface questionTypeOptionsOptions = Mockito.mock(IssueStandardQuestionTypeOptionsOptionsInterface.class);
final List<IssueStandardQuestionTypeOptionModelInterface> questionTypeOptionModels = this.getQuestionTypeOptionModels();
this.questionTypeOptionsService.delete(questionTypeOptionModels, questionTypeOptionsOptions);
for (IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel : questionTypeOptionModels) {
verify(questionTypeOptionsOptions).deleteWithRelations(questionTypeOptionModel);
}
}
use of easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testFindByIssueStandardWithOptions.
@Test
public void testFindByIssueStandardWithOptions() throws Exception {
final Integer issueStandardId = 5;
final List<IssueStandardQuestionTypeOptionEntity> questionTypeOptionEntities = new ArrayList<>(2);
questionTypeOptionEntities.add(Entities.createQuestionTypeOptionEntityMock(1, 1, 1, 10, null, issueStandardId));
questionTypeOptionEntities.add(Entities.createQuestionTypeOptionEntityMock(2, 2, 10, 20, 60, issueStandardId));
final List<IssueStandardQuestionTypeOptionModelInterface> questionTypeOptionModels = new ArrayList<>(2);
questionTypeOptionModels.add(this.mapQuestionTypeOptionModel(questionTypeOptionEntities.get(0)));
questionTypeOptionModels.add(this.mapQuestionTypeOptionModel(questionTypeOptionEntities.get(1)));
final IssueStandardQuestionTypeOptionsOptionsInterface questionTypeOptionsOptions = Mockito.mock(IssueStandardQuestionTypeOptionsOptionsInterface.class);
given(this.questionTypeOptionsMapper.findByIssueStandardId(issueStandardId)).willReturn(questionTypeOptionEntities);
given(questionTypeOptionsOptions.withRelations(questionTypeOptionModels)).willReturn(questionTypeOptionModels);
List<IssueStandardQuestionTypeOptionModelInterface> foundedQuestionTypeOptionModels = this.questionTypeOptionsService.findByIssueStandard(questionTypeOptionModels.get(0).getIssueStandard(), questionTypeOptionsOptions);
verify(questionTypeOptionsOptions).withRelations(questionTypeOptionModels);
Assert.assertNotNull(foundedQuestionTypeOptionModels);
Assert.assertEquals(questionTypeOptionModels, foundedQuestionTypeOptionModels);
}
use of easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testDeleteModelsListWithOptions.
@Test
public void testDeleteModelsListWithOptions() throws Exception {
final ArgumentCaptor<IssueStandardQuestionTypeOptionModelInterface> questionTypeOptionModelCaptor = ArgumentCaptor.forClass(IssueStandardQuestionTypeOptionModelInterface.class);
final List<IssueStandardQuestionTypeOptionModelInterface> questionTypeOptionModels = this.getQuestionTypeOptionFixturesModels();
final IssueStandardQuestionTypeOptionsOptionsInterface questionTypeOptionsOptions = Mockito.mock(IssueStandardQuestionTypeOptionsOptionsInterface.class);
this.questionTypeOptionsService.delete(questionTypeOptionModels, questionTypeOptionsOptions);
this.assertServicesSet(questionTypeOptionsOptions, questionTypeOptionModels.size());
verify(questionTypeOptionsOptions, times(questionTypeOptionModels.size())).deleteWithRelations(questionTypeOptionModelCaptor.capture());
this.questionTypeOptionsSupport.assertModelsListEquals(questionTypeOptionModels, questionTypeOptionModelCaptor.getAllValues());
verifyNoMoreInteractions(this.questionTypeOptionsMapper);
}
use of easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testSaveListWithOptions.
@Test
public void testSaveListWithOptions() throws Exception {
final IssueStandardQuestionTypeOptionsOptionsInterface questionTypeOptionsOptions = Mockito.mock(IssueStandardQuestionTypeOptionsOptionsInterface.class);
final List<IssueStandardQuestionTypeOptionModelInterface> questionTypeOptionModels = this.getQuestionTypeOptionModels();
this.questionTypeOptionsService.save(questionTypeOptionModels, questionTypeOptionsOptions);
for (IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel : questionTypeOptionModels) {
verify(questionTypeOptionsOptions).saveWithRelations(questionTypeOptionModel);
}
}
use of easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testFindAllWithOptions.
@Test
public void testFindAllWithOptions() throws Exception {
final List<IssueStandardQuestionTypeOptionEntity> questionTypeOptionEntities = this.getQuestionTypeOptionEntities();
final List<IssueStandardQuestionTypeOptionModelInterface> questionTypeOptionModels = this.getQuestionTypeOptionModels();
final IssueStandardQuestionTypeOptionsOptionsInterface questionTypeOptionsOptions = Mockito.mock(IssueStandardQuestionTypeOptionsOptionsInterface.class);
given(this.questionTypeOptionsMapper.findAll()).willReturn(questionTypeOptionEntities);
given(questionTypeOptionsOptions.withRelations(Mockito.anyList())).willReturn(questionTypeOptionModels);
final List<IssueStandardQuestionTypeOptionModelInterface> foundedQuestionTypeOptionModels = this.questionTypeOptionsService.findAll(questionTypeOptionsOptions);
verify(questionTypeOptionsOptions).withRelations(questionTypeOptionModels);
Assert.assertNotNull(foundedQuestionTypeOptionModels);
Assert.assertEquals(questionTypeOptionModels, foundedQuestionTypeOptionModels);
}
Aggregations