Search in sources :

Example 6 with TopicModelEmpty

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));
}
Also used : TopicModelEmpty(easytests.core.models.empty.TopicModelEmpty) IssueStandardModelEmpty(easytests.core.models.empty.IssueStandardModelEmpty)

Example 7 with TopicModelEmpty

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());
}
Also used : TopicModelEmpty(easytests.core.models.empty.TopicModelEmpty) IssueStandardTopicPriorityModelInterface(easytests.core.models.IssueStandardTopicPriorityModelInterface) IssueStandardModelEmpty(easytests.core.models.empty.IssueStandardModelEmpty) Test(org.junit.Test)

Example 8 with TopicModelEmpty

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;
}
Also used : TopicModelEmpty(easytests.core.models.empty.TopicModelEmpty) ModelsListEmpty(easytests.core.models.empty.ModelsListEmpty) QuestionTypeModelEmpty(easytests.core.models.empty.QuestionTypeModelEmpty)

Example 9 with TopicModelEmpty

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;
}
Also used : TopicModelEmpty(easytests.core.models.empty.TopicModelEmpty) QuestionModelInterface(easytests.core.models.QuestionModelInterface) ModelsListEmpty(easytests.core.models.empty.ModelsListEmpty) QuestionTypeModelEmpty(easytests.core.models.empty.QuestionTypeModelEmpty)

Example 10 with TopicModelEmpty

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);
}
Also used : TopicModelEmpty(easytests.core.models.empty.TopicModelEmpty) ModelsListEmpty(easytests.core.models.empty.ModelsListEmpty) QuestionTypeModelEmpty(easytests.core.models.empty.QuestionTypeModelEmpty) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

TopicModelEmpty (easytests.core.models.empty.TopicModelEmpty)13 Test (org.junit.Test)8 QuestionTypeModelEmpty (easytests.core.models.empty.QuestionTypeModelEmpty)7 IssueStandardModelEmpty (easytests.core.models.empty.IssueStandardModelEmpty)6 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)6 ModelsListEmpty (easytests.core.models.empty.ModelsListEmpty)5 TopicModelInterface (easytests.core.models.TopicModelInterface)4 TopicsServiceInterface (easytests.core.services.TopicsServiceInterface)4 IssueStandardTopicPriorityModelInterface (easytests.core.models.IssueStandardTopicPriorityModelInterface)3 QuestionModelInterface (easytests.core.models.QuestionModelInterface)3 ArrayList (java.util.ArrayList)3 AnswerModelInterface (easytests.core.models.AnswerModelInterface)2 IssueStandardModelInterface (easytests.core.models.IssueStandardModelInterface)2 QuestionTypeModelInterface (easytests.core.models.QuestionTypeModelInterface)2 AnswersServiceInterface (easytests.core.services.AnswersServiceInterface)2 IssueStandardsServiceInterface (easytests.core.services.IssueStandardsServiceInterface)2 QuestionTypesServiceInterface (easytests.core.services.QuestionTypesServiceInterface)2 IssueStandardTopicPriorityEntity (easytests.core.entities.IssueStandardTopicPriorityEntity)1 QuestionEntity (easytests.core.entities.QuestionEntity)1