use of easytests.core.models.empty.TopicModelEmpty in project easy-tests by malinink.
the class IssueStandardTopicPriorityDto method mapInto.
public void mapInto(IssueStandardTopicPriorityModelInterface topicPriorityModel, Integer issueStandardId) {
topicPriorityModel.setId(this.getId());
topicPriorityModel.setTopic(new TopicModelEmpty(this.getTopicId()));
topicPriorityModel.setIsPreferable(this.getIsPreferable());
topicPriorityModel.setIssueStandard(new IssueStandardModelEmpty(issueStandardId));
}
use of easytests.core.models.empty.TopicModelEmpty in project easy-tests by malinink.
the class IssueStandardTopicPriorityEntityTest method testMap.
@Test
public void testMap() {
final Integer id = 5;
final Integer topicId = 2;
final Boolean isPreferable = true;
final Integer issueStandardId = 1;
final IssueStandardTopicPriorityModelInterface topicPriorityModel = Mockito.mock(IssueStandardTopicPriorityModelInterface.class);
Mockito.when(topicPriorityModel.getId()).thenReturn(id);
Mockito.when(topicPriorityModel.getTopic()).thenReturn(new TopicModelEmpty(topicId));
Mockito.when(topicPriorityModel.getIsPreferable()).thenReturn(isPreferable);
Mockito.when(topicPriorityModel.getIssueStandard()).thenReturn(new IssueStandardModelEmpty(issueStandardId));
final IssueStandardTopicPriorityEntity topicPriorityEntity = new IssueStandardTopicPriorityEntity();
topicPriorityEntity.map(topicPriorityModel);
Assert.assertEquals(id, topicPriorityEntity.getId());
Assert.assertEquals(topicId, topicPriorityEntity.getTopicId());
Assert.assertEquals(isPreferable, topicPriorityEntity.getIsPreferable());
Assert.assertEquals(issueStandardId, topicPriorityEntity.getIssueStandardId());
}
use of easytests.core.models.empty.TopicModelEmpty in project easy-tests by malinink.
the class QuestionsServiceTest method createQuestionModel.
private QuestionModelInterface createQuestionModel(Integer id, String text, Integer questionTypeId, Integer topicId) {
final QuestionModelInterface questionModel = new QuestionModel();
questionModel.setId(id);
questionModel.setText(text);
questionModel.setQuestionType(new QuestionTypeModelEmpty(questionTypeId));
questionModel.setAnswers(new ModelsListEmpty());
questionModel.setTopic(new TopicModelEmpty(topicId));
return questionModel;
}
use of easytests.core.models.empty.TopicModelEmpty in project easy-tests by malinink.
the class QuestionsSupport method getModelMock.
private QuestionModelInterface getModelMock(Integer id, String text, Integer questionTypeId, Integer topicId) {
final QuestionModelInterface questionModel = Mockito.mock(QuestionModelInterface.class);
Mockito.when(questionModel.getId()).thenReturn(id);
Mockito.when(questionModel.getText()).thenReturn(text);
Mockito.when(questionModel.getQuestionType()).thenReturn(new QuestionTypeModelEmpty(questionTypeId));
Mockito.when(questionModel.getTopic()).thenReturn(new TopicModelEmpty(topicId));
Mockito.when(questionModel.getAnswers()).thenReturn(new ModelsListEmpty());
return questionModel;
}
use of easytests.core.models.empty.TopicModelEmpty in project easy-tests by malinink.
the class QuestionsServiceTest method testSaveModel.
@Test
public void testSaveModel() throws Exception {
final QuestionModelInterface questionModel = new QuestionModel();
questionModel.setText("test1");
questionModel.setQuestionType(new QuestionTypeModelEmpty(1));
questionModel.setAnswers(new ModelsListEmpty());
questionModel.setTopic(new TopicModelEmpty(1));
this.questionsService.save(questionModel);
final QuestionModelInterface foundedQuestionModel = this.questionsService.find(questionModel.getId());
Assert.assertEquals(questionModel, foundedQuestionModel);
}
Aggregations