Search in sources :

Example 6 with IssueStandardQuestionTypeOptionModelInterface

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

the class IssueStandardQuestionTypeOptionsServiceTest method testSaveWithOptions.

@Test
public void testSaveWithOptions() throws Exception {
    final IssueStandardQuestionTypeOptionsOptionsInterface questionTypeOptionsOptions = Mockito.mock(IssueStandardQuestionTypeOptionsOptionsInterface.class);
    final IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel = Models.createQuestionTypeOptionModel(1, 2, 10, 20, 60, 2);
    this.questionTypeOptionsService.save(questionTypeOptionModel, questionTypeOptionsOptions);
    verify(questionTypeOptionsOptions).saveWithRelations(questionTypeOptionModel);
}
Also used : IssueStandardQuestionTypeOptionModelInterface(easytests.core.models.IssueStandardQuestionTypeOptionModelInterface) IssueStandardQuestionTypeOptionsOptionsInterface(easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 7 with IssueStandardQuestionTypeOptionModelInterface

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

the class IssueStandardQuestionTypeOptionsServiceTest method testDeleteWithOptions.

@Test
public void testDeleteWithOptions() throws Exception {
    final IssueStandardQuestionTypeOptionsOptionsInterface questionTypeOptionsOptions = Mockito.mock(IssueStandardQuestionTypeOptionsOptionsInterface.class);
    final IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel = Models.createQuestionTypeOptionModel(1, 1, 10, 20, 60, 1);
    this.questionTypeOptionsService.delete(questionTypeOptionModel, questionTypeOptionsOptions);
    verify(questionTypeOptionsOptions).deleteWithRelations(questionTypeOptionModel);
}
Also used : IssueStandardQuestionTypeOptionModelInterface(easytests.core.models.IssueStandardQuestionTypeOptionModelInterface) IssueStandardQuestionTypeOptionsOptionsInterface(easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 8 with IssueStandardQuestionTypeOptionModelInterface

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

the class IssueStandardQuestionTypeOptionsServiceTest method testDeleteListWithOptions.

@Test
public void testDeleteListWithOptions() throws Exception {
    final IssueStandardQuestionTypeOptionsOptionsInterface questionTypeOptionsOptions = Mockito.mock(IssueStandardQuestionTypeOptionsOptionsInterface.class);
    final List<IssueStandardQuestionTypeOptionModelInterface> questionTypeOptionModels = this.getQuestionTypeOptionModels();
    this.questionTypeOptionsService.delete(questionTypeOptionModels, questionTypeOptionsOptions);
    for (IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel : questionTypeOptionModels) {
        verify(questionTypeOptionsOptions).deleteWithRelations(questionTypeOptionModel);
    }
}
Also used : IssueStandardQuestionTypeOptionModelInterface(easytests.core.models.IssueStandardQuestionTypeOptionModelInterface) IssueStandardQuestionTypeOptionsOptionsInterface(easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 9 with IssueStandardQuestionTypeOptionModelInterface

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

the class IssueStandardQuestionTypeOptionsServiceTest method testSaveList.

@Test
public void testSaveList() throws Exception {
    final List<IssueStandardQuestionTypeOptionModelInterface> questionTypeOptionModels = new ArrayList<>(2);
    questionTypeOptionModels.add(Models.createQuestionTypeOptionModel(1, 1, 10, 20, 60, 1));
    questionTypeOptionModels.add(Models.createQuestionTypeOptionModel(null, 1, 10, 20, 60, 1));
    final Integer id = 10;
    doAnswer(invocations -> {
        final IssueStandardQuestionTypeOptionEntity questionTypeOptionEntity = (IssueStandardQuestionTypeOptionEntity) invocations.getArguments()[0];
        questionTypeOptionEntity.setId(id);
        return null;
    }).when(this.questionTypeOptionsMapper).insert(Mockito.any(IssueStandardQuestionTypeOptionEntity.class));
    this.questionTypeOptionsService.save(questionTypeOptionModels);
    verify(this.questionTypeOptionsMapper, times(1)).update(this.mapQuestionTypeOptionEntity(questionTypeOptionModels.get(0)));
    verify(this.questionTypeOptionsMapper, times(1)).insert(this.mapQuestionTypeOptionEntity(questionTypeOptionModels.get(1)));
    Assert.assertEquals(id, questionTypeOptionModels.get(1).getId());
}
Also used : IssueStandardQuestionTypeOptionModelInterface(easytests.core.models.IssueStandardQuestionTypeOptionModelInterface) ArrayList(java.util.ArrayList) IssueStandardQuestionTypeOptionEntity(easytests.core.entities.IssueStandardQuestionTypeOptionEntity) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 10 with IssueStandardQuestionTypeOptionModelInterface

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

the class IssueStandardQuestionTypeOptionsServiceTest method testDeleteList.

@Test
public void testDeleteList() throws Exception {
    final List<IssueStandardQuestionTypeOptionModelInterface> questionTypeOptionModels = this.getQuestionTypeOptionModels();
    this.questionTypeOptionsService.delete(questionTypeOptionModels);
    for (IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel : questionTypeOptionModels) {
        verify(this.questionTypeOptionsMapper, times(1)).delete(this.mapQuestionTypeOptionEntity(questionTypeOptionModel));
    }
}
Also used : IssueStandardQuestionTypeOptionModelInterface(easytests.core.models.IssueStandardQuestionTypeOptionModelInterface) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

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