Search in sources :

Example 21 with IssueStandardQuestionTypeOptionEntity

use of easytests.core.entities.IssueStandardQuestionTypeOptionEntity in project easy-tests by malinink.

the class IssueStandardQuestionTypeOptionsServiceTest method testFindPresentModel.

@Test
public void testFindPresentModel() throws Exception {
    final Integer id = 1;
    final IssueStandardQuestionTypeOptionEntity questionTypeOptionEntity = Entities.createQuestionTypeOptionEntityMock(id, 1, 10, 20, 60, 1);
    given(this.questionTypeOptionsMapper.find(id)).willReturn(questionTypeOptionEntity);
    final IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel = this.questionTypeOptionsService.find(id);
    Assert.assertNotNull(questionTypeOptionModel);
    Assert.assertEquals(this.mapQuestionTypeOptionModel(questionTypeOptionEntity), questionTypeOptionModel);
}
Also used : IssueStandardQuestionTypeOptionModelInterface(easytests.core.models.IssueStandardQuestionTypeOptionModelInterface) IssueStandardQuestionTypeOptionEntity(easytests.core.entities.IssueStandardQuestionTypeOptionEntity) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 22 with IssueStandardQuestionTypeOptionEntity

use of easytests.core.entities.IssueStandardQuestionTypeOptionEntity in project easy-tests by malinink.

the class IssueStandardQuestionTypeOptionsServiceTest method testFindWithOptions.

@Test
public void testFindWithOptions() throws Exception {
    final Integer id = 1;
    final IssueStandardQuestionTypeOptionEntity questionTypeOptionEntity = Entities.createQuestionTypeOptionEntityMock(id, 1, 10, 20, 60, 1);
    final IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel = this.mapQuestionTypeOptionModel(questionTypeOptionEntity);
    final IssueStandardQuestionTypeOptionsOptionsInterface questionTypeOptionsOptions = Mockito.mock(IssueStandardQuestionTypeOptionsOptionsInterface.class);
    given(this.questionTypeOptionsMapper.find(id)).willReturn(questionTypeOptionEntity);
    given(questionTypeOptionsOptions.withRelations(questionTypeOptionModel)).willReturn(questionTypeOptionModel);
    final IssueStandardQuestionTypeOptionModelInterface foundedQuestionTypeOptionModel = this.questionTypeOptionsService.find(id, questionTypeOptionsOptions);
    verify(questionTypeOptionsOptions).withRelations(questionTypeOptionModel);
    Assert.assertNotNull(foundedQuestionTypeOptionModel);
    Assert.assertEquals(questionTypeOptionModel, foundedQuestionTypeOptionModel);
}
Also used : IssueStandardQuestionTypeOptionModelInterface(easytests.core.models.IssueStandardQuestionTypeOptionModelInterface) IssueStandardQuestionTypeOptionsOptionsInterface(easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface) IssueStandardQuestionTypeOptionEntity(easytests.core.entities.IssueStandardQuestionTypeOptionEntity) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

IssueStandardQuestionTypeOptionEntity (easytests.core.entities.IssueStandardQuestionTypeOptionEntity)22 Test (org.junit.Test)14 IssueStandardQuestionTypeOptionModelInterface (easytests.core.models.IssueStandardQuestionTypeOptionModelInterface)9 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)8 IssueStandardQuestionTypeOptionsOptionsInterface (easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface)3 ArrayList (java.util.ArrayList)3 IssueStandardModelInterface (easytests.core.models.IssueStandardModelInterface)1 IssueStandardModelEmpty (easytests.core.models.empty.IssueStandardModelEmpty)1 DeleteUnidentifiedModelException (easytests.core.services.exceptions.DeleteUnidentifiedModelException)1