Search in sources :

Example 6 with IssueStandardTopicPriorityModelInterface

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

the class IssueStandardTopicPrioritiesServiceTest method testDeleteWithOptions.

@Test
public void testDeleteWithOptions() throws Exception {
    final IssueStandardTopicPrioritiesOptionsInterface topicPrioritiesOptions = Mockito.mock(IssueStandardTopicPrioritiesOptionsInterface.class);
    final IssueStandardTopicPriorityModelInterface topicPriorityModel = Models.createTopicPriorityModel(1, 2, false, 1);
    this.topicPrioritiesService.delete(topicPriorityModel, topicPrioritiesOptions);
    verify(topicPrioritiesOptions).deleteWithRelations(topicPriorityModel);
}
Also used : IssueStandardTopicPriorityModelInterface(easytests.core.models.IssueStandardTopicPriorityModelInterface) IssueStandardTopicPrioritiesOptionsInterface(easytests.core.options.IssueStandardTopicPrioritiesOptionsInterface) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 7 with IssueStandardTopicPriorityModelInterface

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

the class IssueStandardTopicPrioritiesServiceTest method testSaveUpdatesEntity.

@Test
public void testSaveUpdatesEntity() throws Exception {
    final IssueStandardTopicPriorityModelInterface topicPriorityModel = Models.createTopicPriorityModel(1, 2, false, 1);
    this.topicPrioritiesService.save(topicPriorityModel);
    verify(this.topicPrioritiesMapper, times(1)).update(this.mapTopicPriorityEntity(topicPriorityModel));
}
Also used : IssueStandardTopicPriorityModelInterface(easytests.core.models.IssueStandardTopicPriorityModelInterface) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 8 with IssueStandardTopicPriorityModelInterface

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

the class IssueStandardTopicPrioritiesServiceTest method testFindWithOptions.

@Test
public void testFindWithOptions() throws Exception {
    final Integer id = 1;
    final IssueStandardTopicPriorityEntity topicPriorityEntity = Entities.createTopicPriorityEntityMock(id, 2, true, 3);
    final IssueStandardTopicPriorityModelInterface topicPriorityModel = this.mapTopicPriorityModel(topicPriorityEntity);
    final IssueStandardTopicPrioritiesOptionsInterface topicPrioritiesOptions = Mockito.mock(IssueStandardTopicPrioritiesOptionsInterface.class);
    given(this.topicPrioritiesMapper.find(id)).willReturn(topicPriorityEntity);
    given(topicPrioritiesOptions.withRelations(topicPriorityModel)).willReturn(topicPriorityModel);
    final IssueStandardTopicPriorityModelInterface foundedTopicPriorityModels = this.topicPrioritiesService.find(id, topicPrioritiesOptions);
    verify(topicPrioritiesOptions).withRelations(topicPriorityModel);
    Assert.assertNotNull(foundedTopicPriorityModels);
    Assert.assertEquals(topicPriorityModel, foundedTopicPriorityModels);
}
Also used : IssueStandardTopicPriorityModelInterface(easytests.core.models.IssueStandardTopicPriorityModelInterface) IssueStandardTopicPriorityEntity(easytests.core.entities.IssueStandardTopicPriorityEntity) IssueStandardTopicPrioritiesOptionsInterface(easytests.core.options.IssueStandardTopicPrioritiesOptionsInterface) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 9 with IssueStandardTopicPriorityModelInterface

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

the class IssueStandardTopicPrioritiesServiceTest method testFindByIssueStandardWithOptions.

@Test
public void testFindByIssueStandardWithOptions() throws Exception {
    Integer issueStandardId = 10;
    final List<IssueStandardTopicPriorityEntity> topicPriorityEntities = new ArrayList<>(2);
    topicPriorityEntities.add(Entities.createTopicPriorityEntityMock(1, 2, true, issueStandardId));
    topicPriorityEntities.add(Entities.createTopicPriorityEntityMock(3, 4, true, issueStandardId));
    final List<IssueStandardTopicPriorityModelInterface> topicPriorityModels = new ArrayList<>(2);
    topicPriorityModels.add(this.mapTopicPriorityModel(topicPriorityEntities.get(0)));
    topicPriorityModels.add(this.mapTopicPriorityModel(topicPriorityEntities.get(1)));
    final IssueStandardTopicPrioritiesOptionsInterface topicPrioritiesOptions = Mockito.mock(IssueStandardTopicPrioritiesOptionsInterface.class);
    given(this.topicPrioritiesMapper.findByIssueStandardId(issueStandardId)).willReturn(topicPriorityEntities);
    given(topicPrioritiesOptions.withRelations(topicPriorityModels)).willReturn(topicPriorityModels);
    final List<IssueStandardTopicPriorityModelInterface> foundedTopicPriorityModels = this.topicPrioritiesService.findByIssueStandard(topicPriorityModels.get(0).getIssueStandard(), topicPrioritiesOptions);
    verify(topicPrioritiesOptions).withRelations(topicPriorityModels);
    Assert.assertNotNull(foundedTopicPriorityModels);
    Assert.assertEquals(topicPriorityModels, foundedTopicPriorityModels);
}
Also used : IssueStandardTopicPriorityModelInterface(easytests.core.models.IssueStandardTopicPriorityModelInterface) IssueStandardTopicPriorityEntity(easytests.core.entities.IssueStandardTopicPriorityEntity) IssueStandardTopicPrioritiesOptionsInterface(easytests.core.options.IssueStandardTopicPrioritiesOptionsInterface) ArrayList(java.util.ArrayList) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 10 with IssueStandardTopicPriorityModelInterface

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

the class IssueStandardTopicPrioritiesServiceTest method testFindPresentModel.

@Test
public void testFindPresentModel() throws Exception {
    final Integer id = 1;
    final IssueStandardTopicPriorityModelInterface topicPriorityModel = Models.createTopicPriorityModel(id, 1, true, 1);
    final IssueStandardTopicPriorityModelInterface foundedIopicPriorityModel = this.topicPrioritiesService.find(id);
    Assert.assertEquals(topicPriorityModel, foundedIopicPriorityModel);
}
Also used : IssueStandardTopicPriorityModelInterface(easytests.core.models.IssueStandardTopicPriorityModelInterface) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

IssueStandardTopicPriorityModelInterface (easytests.core.models.IssueStandardTopicPriorityModelInterface)33 Test (org.junit.Test)30 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)29 IssueStandardModelInterface (easytests.core.models.IssueStandardModelInterface)9 IssueStandardTopicPriorityEntity (easytests.core.entities.IssueStandardTopicPriorityEntity)7 IssueStandardTopicPrioritiesOptionsInterface (easytests.core.options.IssueStandardTopicPrioritiesOptionsInterface)7 ArrayList (java.util.ArrayList)7 IssueStandardsServiceInterface (easytests.core.services.IssueStandardsServiceInterface)5 IssueStandardModelEmpty (easytests.core.models.empty.IssueStandardModelEmpty)4 IssueStandardTopicPrioritiesServiceInterface (easytests.core.services.IssueStandardTopicPrioritiesServiceInterface)4 TopicModelEmpty (easytests.core.models.empty.TopicModelEmpty)3 TopicsServiceInterface (easytests.core.services.TopicsServiceInterface)3 IssueStandardQuestionTypeOptionModelInterface (easytests.core.models.IssueStandardQuestionTypeOptionModelInterface)2 IssueStandardTopicPriorityModel (easytests.core.models.IssueStandardTopicPriorityModel)2 SubjectModelInterface (easytests.core.models.SubjectModelInterface)2 TopicModelInterface (easytests.core.models.TopicModelInterface)2 ModelsListEmpty (easytests.core.models.empty.ModelsListEmpty)2 SubjectModelEmpty (easytests.core.models.empty.SubjectModelEmpty)2 IssueStandardQuestionTypeOptionsServiceInterface (easytests.core.services.IssueStandardQuestionTypeOptionsServiceInterface)2 SubjectsServiceInterface (easytests.core.services.SubjectsServiceInterface)2