Search in sources :

Example 21 with ModelsListEmpty

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

the class SubjectsSupport method getModelMock.

private SubjectModelInterface getModelMock(Integer id, String name, String description, Integer userId) {
    final SubjectModelInterface subjectModel = Mockito.mock(SubjectModelInterface.class);
    Mockito.when(subjectModel.getId()).thenReturn(id);
    Mockito.when(subjectModel.getName()).thenReturn(name);
    Mockito.when(subjectModel.getDescription()).thenReturn(description);
    Mockito.when(subjectModel.getUser()).thenReturn(new UserModelEmpty(userId));
    Mockito.when(subjectModel.getTopics()).thenReturn(new ModelsListEmpty());
    Mockito.when(subjectModel.getIssueStandard()).thenReturn(new IssueStandardModelEmpty());
    Mockito.when(subjectModel.getIssues()).thenReturn(new ModelsListEmpty());
    return subjectModel;
}
Also used : ModelsListEmpty(easytests.core.models.empty.ModelsListEmpty) UserModelEmpty(easytests.core.models.empty.UserModelEmpty) IssueStandardModelEmpty(easytests.core.models.empty.IssueStandardModelEmpty) SubjectModelInterface(easytests.core.models.SubjectModelInterface)

Example 22 with ModelsListEmpty

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

the class TopicsSupport method getModelMock.

private TopicModelInterface getModelMock(Integer id, String name, Integer subjectId) {
    final TopicModelInterface topicModelMock = Mockito.mock(TopicModelInterface.class);
    Mockito.when(topicModelMock.getId()).thenReturn(id);
    Mockito.when(topicModelMock.getName()).thenReturn(name);
    Mockito.when(topicModelMock.getSubject()).thenReturn(new SubjectModelEmpty(subjectId));
    Mockito.when(topicModelMock.getQuestions()).thenReturn(new ModelsListEmpty());
    return topicModelMock;
}
Also used : SubjectModelEmpty(easytests.core.models.empty.SubjectModelEmpty) ModelsListEmpty(easytests.core.models.empty.ModelsListEmpty) TopicModelInterface(easytests.core.models.TopicModelInterface)

Example 23 with ModelsListEmpty

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

the class IssueStandardEntityTest method testMap.

@Test
public void testMap() {
    final Integer id = 5;
    final Integer timeLimit = 3600;
    final Integer questionsNumber = 30;
    final Integer subjectId = 3;
    final IssueStandardModelInterface issueStandardModel = Mockito.mock(IssueStandardModelInterface.class);
    Mockito.when(issueStandardModel.getId()).thenReturn(id);
    Mockito.when(issueStandardModel.getTimeLimit()).thenReturn(timeLimit);
    Mockito.when(issueStandardModel.getQuestionsNumber()).thenReturn(questionsNumber);
    Mockito.when(issueStandardModel.getTopicPriorities()).thenReturn(new ModelsListEmpty());
    Mockito.when(issueStandardModel.getQuestionTypeOptions()).thenReturn(new ModelsListEmpty());
    Mockito.when(issueStandardModel.getSubject()).thenReturn(new SubjectModelEmpty(subjectId));
    final IssueStandardEntity issueStandardEntity = new IssueStandardEntity();
    issueStandardEntity.map(issueStandardModel);
    Assert.assertEquals(id, issueStandardEntity.getId());
    Assert.assertEquals(timeLimit, issueStandardEntity.getTimeLimit());
    Assert.assertEquals(questionsNumber, issueStandardEntity.getQuestionsNumber());
    Assert.assertEquals(subjectId, issueStandardEntity.getSubjectId());
}
Also used : SubjectModelEmpty(easytests.core.models.empty.SubjectModelEmpty) IssueStandardModelInterface(easytests.core.models.IssueStandardModelInterface) ModelsListEmpty(easytests.core.models.empty.ModelsListEmpty) Test(org.junit.Test)

Example 24 with ModelsListEmpty

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

the class IssuesServiceTest method testSaveModel.

@Test
public void testSaveModel() throws Exception {
    final IssueModelInterface issueModel = new IssueModel();
    issueModel.setName("test111");
    issueModel.setQuizzes(new ModelsListEmpty());
    issueModel.setSubject(new SubjectModelEmpty(1));
    this.issuesService.save(issueModel);
    final IssueModelInterface foundIssueModel = this.issuesService.find(issueModel.getId());
    Assert.assertEquals(issueModel, foundIssueModel);
}
Also used : SubjectModelEmpty(easytests.core.models.empty.SubjectModelEmpty) ModelsListEmpty(easytests.core.models.empty.ModelsListEmpty) IssueModelInterface(easytests.core.models.IssueModelInterface) IssueModel(easytests.core.models.IssueModel) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 25 with ModelsListEmpty

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

the class SubjectsServiceTest method createSubjectModel.

private SubjectModelInterface createSubjectModel(Integer id, String name, Integer userId) {
    final SubjectModelInterface subjectModel = new SubjectModel();
    subjectModel.setId(id);
    subjectModel.setName(name);
    subjectModel.setTopics(new ModelsListEmpty());
    subjectModel.setIssueStandard(new IssueStandardModelEmpty());
    subjectModel.setUser(new UserModelEmpty(userId));
    subjectModel.setIssues(new ModelsListEmpty());
    return subjectModel;
}
Also used : ModelsListEmpty(easytests.core.models.empty.ModelsListEmpty) UserModelEmpty(easytests.core.models.empty.UserModelEmpty) IssueStandardModelEmpty(easytests.core.models.empty.IssueStandardModelEmpty)

Aggregations

ModelsListEmpty (easytests.core.models.empty.ModelsListEmpty)36 Test (org.junit.Test)13 SubjectModelEmpty (easytests.core.models.empty.SubjectModelEmpty)11 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)8 IssueStandardModelEmpty (easytests.core.models.empty.IssueStandardModelEmpty)7 UserModelEmpty (easytests.core.models.empty.UserModelEmpty)7 QuestionTypeModelEmpty (easytests.core.models.empty.QuestionTypeModelEmpty)5 TopicModelEmpty (easytests.core.models.empty.TopicModelEmpty)5 IssueStandardModelInterface (easytests.core.models.IssueStandardModelInterface)4 SubjectModelInterface (easytests.core.models.SubjectModelInterface)4 IssueModelEmpty (easytests.core.models.empty.IssueModelEmpty)3 QuestionModelEmpty (easytests.core.models.empty.QuestionModelEmpty)3 QuizModelEmpty (easytests.core.models.empty.QuizModelEmpty)3 TesteeModelEmpty (easytests.core.models.empty.TesteeModelEmpty)3 IssueStandardQuestionTypeOptionModelInterface (easytests.core.models.IssueStandardQuestionTypeOptionModelInterface)2 IssueStandardTopicPriorityModelInterface (easytests.core.models.IssueStandardTopicPriorityModelInterface)2 IssueStandardQuestionTypeOptionsServiceInterface (easytests.core.services.IssueStandardQuestionTypeOptionsServiceInterface)2 IssueStandardTopicPrioritiesServiceInterface (easytests.core.services.IssueStandardTopicPrioritiesServiceInterface)2 SubjectsServiceInterface (easytests.core.services.SubjectsServiceInterface)2 ArrayList (java.util.ArrayList)2