Search in sources :

Example 6 with IssueStandardTopicPriorityEntity

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

the class IssueStandardTopicPrioritiesService method save.

@Override
public void save(IssueStandardTopicPriorityModelInterface topicPriorityModel) {
    final IssueStandardTopicPriorityEntity topicPriorityEntity = this.map(topicPriorityModel);
    if (topicPriorityEntity.getId() != null) {
        this.topicPrioritiesMapper.update(topicPriorityEntity);
        return;
    }
    this.topicPrioritiesMapper.insert(topicPriorityEntity);
    topicPriorityModel.setId(topicPriorityEntity.getId());
}
Also used : IssueStandardTopicPriorityEntity(easytests.core.entities.IssueStandardTopicPriorityEntity)

Example 7 with IssueStandardTopicPriorityEntity

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

the class IssueStandardTopicPriorityModelTest method testMap.

@Test
public void testMap() {
    final Integer id = 5;
    final Integer topicId = 3;
    final Boolean isPreferable = false;
    final Integer issueStandardId = 2;
    final IssueStandardTopicPriorityEntity topicPriorityEntity = Mockito.mock(IssueStandardTopicPriorityEntity.class);
    Mockito.when(topicPriorityEntity.getId()).thenReturn(id);
    Mockito.when(topicPriorityEntity.getTopicId()).thenReturn(topicId);
    Mockito.when(topicPriorityEntity.getIsPreferable()).thenReturn(isPreferable);
    Mockito.when(topicPriorityEntity.getIssueStandardId()).thenReturn(issueStandardId);
    final IssueStandardTopicPriorityModelInterface topicPriorityModel = new IssueStandardTopicPriorityModel();
    topicPriorityModel.map(topicPriorityEntity);
    Assert.assertEquals(id, topicPriorityModel.getId());
    Assert.assertEquals(new TopicModelEmpty(topicId), topicPriorityModel.getTopic());
    Assert.assertEquals(isPreferable, topicPriorityModel.getIsPreferable());
    Assert.assertEquals(new IssueStandardModelEmpty(issueStandardId), topicPriorityModel.getIssueStandard());
}
Also used : TopicModelEmpty(easytests.core.models.empty.TopicModelEmpty) IssueStandardTopicPriorityEntity(easytests.core.entities.IssueStandardTopicPriorityEntity) IssueStandardModelEmpty(easytests.core.models.empty.IssueStandardModelEmpty) Test(org.junit.Test)

Example 8 with IssueStandardTopicPriorityEntity

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

the class IssueStandardTopicPrioritiesService method map.

private IssueStandardTopicPriorityEntity map(IssueStandardTopicPriorityModelInterface topicPriorityModel) {
    final IssueStandardTopicPriorityEntity topicPriorityEntity = new IssueStandardTopicPriorityEntity();
    topicPriorityEntity.map(topicPriorityModel);
    return topicPriorityEntity;
}
Also used : IssueStandardTopicPriorityEntity(easytests.core.entities.IssueStandardTopicPriorityEntity)

Example 9 with IssueStandardTopicPriorityEntity

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

the class IssueStandardTopicPrioritiesService method delete.

@Override
public void delete(IssueStandardTopicPriorityModelInterface topicPriorityModel) {
    final IssueStandardTopicPriorityEntity topicPriorityEntity = this.map(topicPriorityModel);
    if (topicPriorityEntity.getId() == null) {
        throw new DeleteUnidentifiedModelException();
    }
    this.topicPrioritiesMapper.delete(topicPriorityEntity);
}
Also used : IssueStandardTopicPriorityEntity(easytests.core.entities.IssueStandardTopicPriorityEntity) DeleteUnidentifiedModelException(easytests.core.services.exceptions.DeleteUnidentifiedModelException)

Example 10 with IssueStandardTopicPriorityEntity

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

the class IssueStandardTopicPrioritiesServiceTest method mapTopicPriorityEntity.

private IssueStandardTopicPriorityEntity mapTopicPriorityEntity(IssueStandardTopicPriorityModelInterface topicPriorityModel) {
    final IssueStandardTopicPriorityEntity topicPriorityEntity = new IssueStandardTopicPriorityEntity();
    topicPriorityEntity.map(topicPriorityModel);
    return topicPriorityEntity;
}
Also used : IssueStandardTopicPriorityEntity(easytests.core.entities.IssueStandardTopicPriorityEntity)

Aggregations

IssueStandardTopicPriorityEntity (easytests.core.entities.IssueStandardTopicPriorityEntity)12 Test (org.junit.Test)8 IssueStandardTopicPriorityModelInterface (easytests.core.models.IssueStandardTopicPriorityModelInterface)7 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)7 IssueStandardTopicPrioritiesOptionsInterface (easytests.core.options.IssueStandardTopicPrioritiesOptionsInterface)3 ArrayList (java.util.ArrayList)3 IssueStandardModelInterface (easytests.core.models.IssueStandardModelInterface)1 IssueStandardModelEmpty (easytests.core.models.empty.IssueStandardModelEmpty)1 TopicModelEmpty (easytests.core.models.empty.TopicModelEmpty)1 DeleteUnidentifiedModelException (easytests.core.services.exceptions.DeleteUnidentifiedModelException)1