use of easytests.core.options.IssueStandardsOptionsInterface in project easy-tests by malinink.
the class IssueStandardsServiceTest method testFindBySubjectWithOptions.
@Test
public void testFindBySubjectWithOptions() throws Exception {
final Integer subjectId = 3;
final IssueStandardEntity issueStandardEntity = Entities.createIssueStandardEntityMock(3, 600, 10, subjectId);
final IssueStandardModelInterface issueStandardModel = this.mapIssueStandardModel(issueStandardEntity);
final IssueStandardsOptionsInterface issueStandardsOptions = Mockito.mock(IssueStandardsOptionsInterface.class);
given(this.issueStandardsMapper.findBySubjectId(subjectId)).willReturn(issueStandardEntity);
given(issueStandardsOptions.withRelations(issueStandardModel)).willReturn(issueStandardModel);
final IssueStandardModelInterface foundedIssueStandardModel = this.issueStandardsService.findBySubject(issueStandardModel.getSubject(), issueStandardsOptions);
verify(issueStandardsOptions).withRelations(issueStandardModel);
Assert.assertNotNull(foundedIssueStandardModel);
Assert.assertEquals(issueStandardModel, foundedIssueStandardModel);
}
use of easytests.core.options.IssueStandardsOptionsInterface in project easy-tests by malinink.
the class IssueStandardsServiceTest method testFindWithOptions.
@Test
public void testFindWithOptions() throws Exception {
final Integer id = 1;
final IssueStandardEntity issueStandardEntity = Entities.createIssueStandardEntityMock(id, 1200, 20, 2);
final IssueStandardModelInterface issueStandardModel = this.mapIssueStandardModel(issueStandardEntity);
final IssueStandardsOptionsInterface issueStandardsOptions = Mockito.mock(IssueStandardsOptionsInterface.class);
given(this.issueStandardsMapper.find(id)).willReturn(issueStandardEntity);
given(issueStandardsOptions.withRelations(issueStandardModel)).willReturn(issueStandardModel);
final IssueStandardModelInterface foundedIssueStandardModel = this.issueStandardsService.find(id, issueStandardsOptions);
verify(issueStandardsOptions).withRelations(issueStandardModel);
Assert.assertNotNull(foundedIssueStandardModel);
Assert.assertEquals(issueStandardModel, foundedIssueStandardModel);
}
use of easytests.core.options.IssueStandardsOptionsInterface in project easy-tests by malinink.
the class IssueStandardsServiceTest method testFindAllWithOptions.
@Test
public void testFindAllWithOptions() throws Exception {
final List<IssueStandardEntity> issueStandardEntities = this.getIssueStandardEntities();
final List<IssueStandardModelInterface> issueStandardModels = this.getIssueStandardModels();
final IssueStandardsOptionsInterface issueStandardsOptions = Mockito.mock(IssueStandardsOptionsInterface.class);
given(this.issueStandardsMapper.findAll()).willReturn(issueStandardEntities);
given(issueStandardsOptions.withRelations(Mockito.anyList())).willReturn(issueStandardModels);
List<IssueStandardModelInterface> foundedIssueStandardModels = this.issueStandardsService.findAll(issueStandardsOptions);
verify(issueStandardsOptions).withRelations(issueStandardModels);
Assert.assertNotNull(foundedIssueStandardModels);
Assert.assertEquals(issueStandardModels, foundedIssueStandardModels);
}
use of easytests.core.options.IssueStandardsOptionsInterface in project easy-tests by malinink.
the class IssueStandardTopicPrioritiesOptionsBuilderTest method testForAuth.
@Test
public void testForAuth() throws Exception {
final IssueStandardsOptionsInterface issueStandardsOptions = new IssueStandardsOptions();
given(this.issueStandardsOptionsBuilder.forAuth()).willReturn(issueStandardsOptions);
final IssueStandardTopicPrioritiesOptionsInterface topicPrioritiesOptions = this.topicPrioritiesOptionsBuilder.forAuth();
Assert.assertEquals(new IssueStandardTopicPrioritiesOptions().withIssueStandard(issueStandardsOptions), topicPrioritiesOptions);
}
Aggregations