Search in sources :

Example 6 with IssueStandardsOptionsInterface

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);
}
Also used : IssueStandardsOptionsInterface(easytests.core.options.IssueStandardsOptionsInterface)

Example 7 with IssueStandardsOptionsInterface

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);
}
Also used : IssueStandardsOptionsInterface(easytests.core.options.IssueStandardsOptionsInterface)

Example 8 with IssueStandardsOptionsInterface

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);
}
Also used : IssueStandardsOptionsInterface(easytests.core.options.IssueStandardsOptionsInterface)

Example 9 with IssueStandardsOptionsInterface

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);
}
Also used : IssueStandardsOptionsInterface(easytests.core.options.IssueStandardsOptionsInterface) IssueStandardTopicPrioritiesOptionsInterface(easytests.core.options.IssueStandardTopicPrioritiesOptionsInterface) IssueStandardTopicPrioritiesOptions(easytests.core.options.IssueStandardTopicPrioritiesOptions) IssueStandardsOptions(easytests.core.options.IssueStandardsOptions) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Test(org.junit.Test)

Aggregations

IssueStandardsOptionsInterface (easytests.core.options.IssueStandardsOptionsInterface)9 IssueStandardsOptions (easytests.core.options.IssueStandardsOptions)2 Test (org.junit.Test)2 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)2 IssueStandardQuestionTypeOptionsOptions (easytests.core.options.IssueStandardQuestionTypeOptionsOptions)1 IssueStandardQuestionTypeOptionsOptionsInterface (easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface)1 IssueStandardTopicPrioritiesOptions (easytests.core.options.IssueStandardTopicPrioritiesOptions)1 IssueStandardTopicPrioritiesOptionsInterface (easytests.core.options.IssueStandardTopicPrioritiesOptionsInterface)1