use of easytests.core.services.IssueStandardTopicPrioritiesServiceInterface in project easy-tests by malinink.
the class IssueStandardOptionsTest method testWithRelationsOnNull.
@Test
public void testWithRelationsOnNull() throws Exception {
final IssueStandardsOptionsInterface issueStandardsOptions = new IssueStandardsOptions();
final IssueStandardTopicPrioritiesServiceInterface topicPrioritiesService = Mockito.mock(IssueStandardTopicPrioritiesServiceInterface.class);
final IssueStandardTopicPrioritiesOptionsInterface topicPrioritiesOptions = Mockito.mock(IssueStandardTopicPrioritiesOptionsInterface.class);
final IssueStandardQuestionTypeOptionsServiceInterface questionTypeOptionsService = Mockito.mock(IssueStandardQuestionTypeOptionsServiceInterface.class);
final IssueStandardQuestionTypeOptionsOptionsInterface questionTypeOptionsOptions = Mockito.mock(IssueStandardQuestionTypeOptionsOptionsInterface.class);
final SubjectsServiceInterface subjectsService = Mockito.mock(SubjectsServiceInterface.class);
final SubjectsOptionsInterface subjectsOptions = Mockito.mock(SubjectsOptionsInterface.class);
issueStandardsOptions.setTopicPrioritiesService(topicPrioritiesService);
issueStandardsOptions.setQuestionTypeOptionsService(questionTypeOptionsService);
issueStandardsOptions.setSubjectsService(subjectsService);
issueStandardsOptions.withTopicPriorities(topicPrioritiesOptions).withQuestionTypeOptions(questionTypeOptionsOptions).withSubject(subjectsOptions);
final IssueStandardModelInterface issueStandardModel = null;
final IssueStandardModelInterface issueStandardModelWithRelations = issueStandardsOptions.withRelations(issueStandardModel);
Assert.assertEquals(null, issueStandardModelWithRelations);
}
use of easytests.core.services.IssueStandardTopicPrioritiesServiceInterface in project easy-tests by malinink.
the class IssueStandardOptionsTest method testDeleteWithRelations.
@Test
public void testDeleteWithRelations() throws Exception {
final IssueStandardsOptionsInterface issueStandardsOptions = new IssueStandardsOptions();
final IssueStandardsServiceInterface issueStandardsService = Mockito.mock(IssueStandardsServiceInterface.class);
final IssueStandardTopicPrioritiesServiceInterface topicPrioritiesService = Mockito.mock(IssueStandardTopicPrioritiesServiceInterface.class);
final IssueStandardTopicPrioritiesOptionsInterface topicPrioritiesOptions = Mockito.mock(IssueStandardTopicPrioritiesOptionsInterface.class);
final IssueStandardQuestionTypeOptionsServiceInterface questionTypeOptionsService = Mockito.mock(IssueStandardQuestionTypeOptionsServiceInterface.class);
final IssueStandardQuestionTypeOptionsOptionsInterface questionTypeOptionsOptions = Mockito.mock(IssueStandardQuestionTypeOptionsOptionsInterface.class);
final SubjectsServiceInterface subjectsService = Mockito.mock(SubjectsServiceInterface.class);
final SubjectsOptionsInterface subjectsOptions = Mockito.mock(SubjectsOptionsInterface.class);
final Integer subjectId = 3;
final SubjectModelInterface subjectModel = Mockito.mock(SubjectModelInterface.class);
Mockito.when(subjectModel.getId()).thenReturn(subjectId);
final IssueStandardModelInterface issueStandardModel = Mockito.mock(IssueStandardModelInterface.class);
Mockito.when(issueStandardModel.getTopicPriorities()).thenReturn(new ArrayList<>());
Mockito.when(issueStandardModel.getQuestionTypeOptions()).thenReturn(new ArrayList<>());
Mockito.when(issueStandardModel.getSubject()).thenReturn(subjectModel);
issueStandardsOptions.setIssueStandardsService(issueStandardsService);
issueStandardsOptions.setTopicPrioritiesService(topicPrioritiesService);
issueStandardsOptions.setQuestionTypeOptionsService(questionTypeOptionsService);
issueStandardsOptions.setSubjectsService(subjectsService);
issueStandardsOptions.withTopicPriorities(topicPrioritiesOptions).withQuestionTypeOptions(questionTypeOptionsOptions).withSubject(subjectsOptions);
final InOrder inOrder = Mockito.inOrder(subjectsService, issueStandardsService, topicPrioritiesService, questionTypeOptionsService);
issueStandardsOptions.deleteWithRelations(issueStandardModel);
inOrder.verify(topicPrioritiesService, times(1)).delete(issueStandardModel.getTopicPriorities(), topicPrioritiesOptions);
inOrder.verify(questionTypeOptionsService, times(1)).delete(issueStandardModel.getQuestionTypeOptions(), questionTypeOptionsOptions);
inOrder.verify(issueStandardsService, times(1)).delete(issueStandardModel);
inOrder.verify(subjectsService, times(1)).delete(issueStandardModel.getSubject(), subjectsOptions);
}
Aggregations