use of easytests.core.models.IssueStandardQuestionTypeOptionModelInterface in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testSaveModelsListWithOptions.
@Test
public void testSaveModelsListWithOptions() 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.save(questionTypeOptionModels, questionTypeOptionsOptions);
this.assertServicesSet(questionTypeOptionsOptions, questionTypeOptionModels.size());
verify(questionTypeOptionsOptions, times(questionTypeOptionModels.size())).saveWithRelations(questionTypeOptionModelCaptor.capture());
this.questionTypeOptionsSupport.assertModelsListEquals(questionTypeOptionModels, questionTypeOptionModelCaptor.getAllValues());
verifyNoMoreInteractions(this.questionTypeOptionsMapper);
}
use of easytests.core.models.IssueStandardQuestionTypeOptionModelInterface in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsSupport method assertModelsListEquals.
public void assertModelsListEquals(List<IssueStandardQuestionTypeOptionModelInterface> expected, List<IssueStandardQuestionTypeOptionModelInterface> actual) {
Assert.assertEquals(expected.size(), actual.size());
Integer i = 0;
for (IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel : expected) {
this.assertEquals(questionTypeOptionModel, actual.get(i));
i++;
}
}
use of easytests.core.models.IssueStandardQuestionTypeOptionModelInterface in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testSaveUpdatesModel.
@Test
public void testSaveUpdatesModel() throws Exception {
final Integer id = 1;
final IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel = Models.createQuestionTypeOptionModel(id, 1, 10, 20, 300, 1);
Assert.assertNotEquals(questionTypeOptionModel, this.questionTypeOptionsService.find(id));
this.questionTypeOptionsService.save(questionTypeOptionModel);
Assert.assertEquals(questionTypeOptionModel, this.questionTypeOptionsService.find(id));
}
use of easytests.core.models.IssueStandardQuestionTypeOptionModelInterface in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testFindWithOptions.
@Test
public void testFindWithOptions() throws Exception {
final Integer id = 1;
final Integer issueStandardId = 1;
final IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel = Models.createQuestionTypeOptionModel(id, 1, 1, null, null, issueStandardId);
final IssueStandardModelInterface issueStandardModel = Models.createIssueStandardModel(issueStandardId, 300, 30, 1);
questionTypeOptionModel.setIssueStandard(issueStandardModel);
final IssueStandardQuestionTypeOptionModelInterface foundedQuestionTypeOptionModel = this.questionTypeOptionsService.find(id, new IssueStandardQuestionTypeOptionsOptions().withIssueStandard(new IssueStandardsOptions()));
Assert.assertEquals(questionTypeOptionModel, foundedQuestionTypeOptionModel);
Assert.assertEquals(issueStandardModel, foundedQuestionTypeOptionModel.getIssueStandard());
}
use of easytests.core.models.IssueStandardQuestionTypeOptionModelInterface in project easy-tests by malinink.
the class IssueStandardQuestionTypeOptionsServiceTest method testFindAbsentModel.
@Test
public void testFindAbsentModel() throws Exception {
final Integer id = 10;
final IssueStandardQuestionTypeOptionModelInterface foundedQuestionTypeOptionModel = this.questionTypeOptionsService.find(id);
Assert.assertNull(foundedQuestionTypeOptionModel);
}
Aggregations