Search in sources :

Example 16 with IssueStandardQuestionTypeOptionModelInterface

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));
}
Also used : IssueStandardQuestionTypeOptionModelInterface(easytests.core.models.IssueStandardQuestionTypeOptionModelInterface) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 17 with IssueStandardQuestionTypeOptionModelInterface

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

Example 18 with IssueStandardQuestionTypeOptionModelInterface

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);
}
Also used : IssueStandardQuestionTypeOptionModelInterface(easytests.core.models.IssueStandardQuestionTypeOptionModelInterface) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 19 with IssueStandardQuestionTypeOptionModelInterface

use of easytests.core.models.IssueStandardQuestionTypeOptionModelInterface in project easy-tests by malinink.

the class IssueStandardQuestionTypeOptionsServiceTest method testFindPresentModel.

@Test
public void testFindPresentModel() throws Exception {
    final Integer id = 1;
    final IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel = Models.createQuestionTypeOptionModel(id, 1, 1, null, null, 1);
    final IssueStandardQuestionTypeOptionModelInterface foundedQuestionTypeOptionModel = this.questionTypeOptionsService.find(id);
    Assert.assertEquals(questionTypeOptionModel, foundedQuestionTypeOptionModel);
}
Also used : IssueStandardQuestionTypeOptionModelInterface(easytests.core.models.IssueStandardQuestionTypeOptionModelInterface) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 20 with IssueStandardQuestionTypeOptionModelInterface

use of easytests.core.models.IssueStandardQuestionTypeOptionModelInterface in project easy-tests by malinink.

the class IssueStandardQuestionTypeOptionsServiceTest method testSaveCreatesEntity.

@Test
public void testSaveCreatesEntity() throws Exception {
    final ArgumentCaptor<IssueStandardQuestionTypeOptionEntity> questionTypeOptionEntityCaptor = ArgumentCaptor.forClass(IssueStandardQuestionTypeOptionEntity.class);
    final IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel = this.questionTypeOptionsSupport.getModelAdditionalMock(0);
    this.questionTypeOptionsService.save(questionTypeOptionModel);
    verify(this.questionTypeOptionsMapper, times(1)).insert(questionTypeOptionEntityCaptor.capture());
    this.questionTypeOptionsSupport.assertEquals(this.questionTypeOptionsSupport.getEntityAdditionalMock(0), questionTypeOptionEntityCaptor.getValue());
}
Also used : IssueStandardQuestionTypeOptionModelInterface(easytests.core.models.IssueStandardQuestionTypeOptionModelInterface) IssueStandardQuestionTypeOptionEntity(easytests.core.entities.IssueStandardQuestionTypeOptionEntity)

Aggregations

IssueStandardQuestionTypeOptionModelInterface (easytests.core.models.IssueStandardQuestionTypeOptionModelInterface)39 Test (org.junit.Test)30 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)29 IssueStandardQuestionTypeOptionEntity (easytests.core.entities.IssueStandardQuestionTypeOptionEntity)9 IssueStandardModelInterface (easytests.core.models.IssueStandardModelInterface)9 IssueStandardQuestionTypeOptionsOptionsInterface (easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface)9 ArrayList (java.util.ArrayList)7 IssueStandardModelEmpty (easytests.core.models.empty.IssueStandardModelEmpty)5 IssueStandardsServiceInterface (easytests.core.services.IssueStandardsServiceInterface)5 QuestionTypeModelEmpty (easytests.core.models.empty.QuestionTypeModelEmpty)4 IssueStandardQuestionTypeOptionsServiceInterface (easytests.core.services.IssueStandardQuestionTypeOptionsServiceInterface)4 QuestionTypesServiceInterface (easytests.core.services.QuestionTypesServiceInterface)3 IssueStandardQuestionTypeOptionModel (easytests.core.models.IssueStandardQuestionTypeOptionModel)2 IssueStandardTopicPriorityModelInterface (easytests.core.models.IssueStandardTopicPriorityModelInterface)2 QuestionTypeModelInterface (easytests.core.models.QuestionTypeModelInterface)2 SubjectModelInterface (easytests.core.models.SubjectModelInterface)2 ModelsListEmpty (easytests.core.models.empty.ModelsListEmpty)2 SubjectModelEmpty (easytests.core.models.empty.SubjectModelEmpty)2 IssueStandardTopicPrioritiesServiceInterface (easytests.core.services.IssueStandardTopicPrioritiesServiceInterface)2 SubjectsServiceInterface (easytests.core.services.SubjectsServiceInterface)2