Search in sources :

Example 6 with IssueStandardQuestionTypeOptionsOptionsInterface

use of easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface 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 7 with IssueStandardQuestionTypeOptionsOptionsInterface

use of easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface in project easy-tests by malinink.

the class IssueStandardQuestionTypeOptionsServiceTest method testFindByIssueStandardWithOptions.

@Test
public void testFindByIssueStandardWithOptions() throws Exception {
    final Integer issueStandardId = 5;
    final List<IssueStandardQuestionTypeOptionEntity> questionTypeOptionEntities = new ArrayList<>(2);
    questionTypeOptionEntities.add(Entities.createQuestionTypeOptionEntityMock(1, 1, 1, 10, null, issueStandardId));
    questionTypeOptionEntities.add(Entities.createQuestionTypeOptionEntityMock(2, 2, 10, 20, 60, issueStandardId));
    final List<IssueStandardQuestionTypeOptionModelInterface> questionTypeOptionModels = new ArrayList<>(2);
    questionTypeOptionModels.add(this.mapQuestionTypeOptionModel(questionTypeOptionEntities.get(0)));
    questionTypeOptionModels.add(this.mapQuestionTypeOptionModel(questionTypeOptionEntities.get(1)));
    final IssueStandardQuestionTypeOptionsOptionsInterface questionTypeOptionsOptions = Mockito.mock(IssueStandardQuestionTypeOptionsOptionsInterface.class);
    given(this.questionTypeOptionsMapper.findByIssueStandardId(issueStandardId)).willReturn(questionTypeOptionEntities);
    given(questionTypeOptionsOptions.withRelations(questionTypeOptionModels)).willReturn(questionTypeOptionModels);
    List<IssueStandardQuestionTypeOptionModelInterface> foundedQuestionTypeOptionModels = this.questionTypeOptionsService.findByIssueStandard(questionTypeOptionModels.get(0).getIssueStandard(), questionTypeOptionsOptions);
    verify(questionTypeOptionsOptions).withRelations(questionTypeOptionModels);
    Assert.assertNotNull(foundedQuestionTypeOptionModels);
    Assert.assertEquals(questionTypeOptionModels, foundedQuestionTypeOptionModels);
}
Also used : IssueStandardQuestionTypeOptionModelInterface(easytests.core.models.IssueStandardQuestionTypeOptionModelInterface) ArrayList(java.util.ArrayList) IssueStandardQuestionTypeOptionsOptionsInterface(easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface) IssueStandardQuestionTypeOptionEntity(easytests.core.entities.IssueStandardQuestionTypeOptionEntity) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 8 with IssueStandardQuestionTypeOptionsOptionsInterface

use of easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface in project easy-tests by malinink.

the class IssueStandardQuestionTypeOptionsServiceTest method testDeleteModelsListWithOptions.

@Test
public void testDeleteModelsListWithOptions() throws Exception {
    final ArgumentCaptor<IssueStandardQuestionTypeOptionModelInterface> questionTypeOptionModelCaptor = ArgumentCaptor.forClass(IssueStandardQuestionTypeOptionModelInterface.class);
    final List<IssueStandardQuestionTypeOptionModelInterface> questionTypeOptionModels = this.getQuestionTypeOptionFixturesModels();
    final IssueStandardQuestionTypeOptionsOptionsInterface questionTypeOptionsOptions = Mockito.mock(IssueStandardQuestionTypeOptionsOptionsInterface.class);
    this.questionTypeOptionsService.delete(questionTypeOptionModels, questionTypeOptionsOptions);
    this.assertServicesSet(questionTypeOptionsOptions, questionTypeOptionModels.size());
    verify(questionTypeOptionsOptions, times(questionTypeOptionModels.size())).deleteWithRelations(questionTypeOptionModelCaptor.capture());
    this.questionTypeOptionsSupport.assertModelsListEquals(questionTypeOptionModels, questionTypeOptionModelCaptor.getAllValues());
    verifyNoMoreInteractions(this.questionTypeOptionsMapper);
}
Also used : IssueStandardQuestionTypeOptionModelInterface(easytests.core.models.IssueStandardQuestionTypeOptionModelInterface) IssueStandardQuestionTypeOptionsOptionsInterface(easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface)

Example 9 with IssueStandardQuestionTypeOptionsOptionsInterface

use of easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface in project easy-tests by malinink.

the class IssueStandardQuestionTypeOptionsServiceTest method testSaveListWithOptions.

@Test
public void testSaveListWithOptions() throws Exception {
    final IssueStandardQuestionTypeOptionsOptionsInterface questionTypeOptionsOptions = Mockito.mock(IssueStandardQuestionTypeOptionsOptionsInterface.class);
    final List<IssueStandardQuestionTypeOptionModelInterface> questionTypeOptionModels = this.getQuestionTypeOptionModels();
    this.questionTypeOptionsService.save(questionTypeOptionModels, questionTypeOptionsOptions);
    for (IssueStandardQuestionTypeOptionModelInterface questionTypeOptionModel : questionTypeOptionModels) {
        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 10 with IssueStandardQuestionTypeOptionsOptionsInterface

use of easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface in project easy-tests by malinink.

the class IssueStandardQuestionTypeOptionsServiceTest method testFindAllWithOptions.

@Test
public void testFindAllWithOptions() throws Exception {
    final List<IssueStandardQuestionTypeOptionEntity> questionTypeOptionEntities = this.getQuestionTypeOptionEntities();
    final List<IssueStandardQuestionTypeOptionModelInterface> questionTypeOptionModels = this.getQuestionTypeOptionModels();
    final IssueStandardQuestionTypeOptionsOptionsInterface questionTypeOptionsOptions = Mockito.mock(IssueStandardQuestionTypeOptionsOptionsInterface.class);
    given(this.questionTypeOptionsMapper.findAll()).willReturn(questionTypeOptionEntities);
    given(questionTypeOptionsOptions.withRelations(Mockito.anyList())).willReturn(questionTypeOptionModels);
    final List<IssueStandardQuestionTypeOptionModelInterface> foundedQuestionTypeOptionModels = this.questionTypeOptionsService.findAll(questionTypeOptionsOptions);
    verify(questionTypeOptionsOptions).withRelations(questionTypeOptionModels);
    Assert.assertNotNull(foundedQuestionTypeOptionModels);
    Assert.assertEquals(questionTypeOptionModels, foundedQuestionTypeOptionModels);
}
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

IssueStandardQuestionTypeOptionsOptionsInterface (easytests.core.options.IssueStandardQuestionTypeOptionsOptionsInterface)11 IssueStandardQuestionTypeOptionModelInterface (easytests.core.models.IssueStandardQuestionTypeOptionModelInterface)9 Test (org.junit.Test)9 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)9 IssueStandardQuestionTypeOptionEntity (easytests.core.entities.IssueStandardQuestionTypeOptionEntity)3 IssueStandardQuestionTypeOptionsOptions (easytests.core.options.IssueStandardQuestionTypeOptionsOptions)2 IssueStandardsOptions (easytests.core.options.IssueStandardsOptions)1 IssueStandardsOptionsInterface (easytests.core.options.IssueStandardsOptionsInterface)1 ArrayList (java.util.ArrayList)1