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());
}
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());
}
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;
}
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);
}
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;
}
Aggregations