Search in sources :

Example 16 with SubjectModelEmpty

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

the class IssueModelTest method testMap.

@Test
public void testMap() throws Exception {
    final Integer issueId = 1;
    final String name = "Name";
    final Integer subjectId = 1;
    final IssueEntity issueEntity = Mockito.mock(IssueEntity.class);
    Mockito.when(issueEntity.getId()).thenReturn(issueId);
    Mockito.when(issueEntity.getName()).thenReturn(name);
    Mockito.when(issueEntity.getSubjectId()).thenReturn(subjectId);
    final IssueModel issueModel = new IssueModel();
    issueModel.map(issueEntity);
    Assert.assertEquals(issueId, issueModel.getId());
    Assert.assertEquals(name, issueModel.getName());
    Assert.assertEquals(new ModelsListEmpty(), issueModel.getQuizzes());
    Assert.assertEquals(new SubjectModelEmpty(subjectId), issueModel.getSubject());
}
Also used : SubjectModelEmpty(easytests.core.models.empty.SubjectModelEmpty) ModelsListEmpty(easytests.core.models.empty.ModelsListEmpty) IssueEntity(easytests.core.entities.IssueEntity) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Test(org.junit.Test)

Aggregations

SubjectModelEmpty (easytests.core.models.empty.SubjectModelEmpty)16 ModelsListEmpty (easytests.core.models.empty.ModelsListEmpty)11 Test (org.junit.Test)9 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)6 IssueStandardModelInterface (easytests.core.models.IssueStandardModelInterface)5 SubjectModelInterface (easytests.core.models.SubjectModelInterface)5 ArrayList (java.util.ArrayList)5 IssueModelInterface (easytests.core.models.IssueModelInterface)4 SubjectsServiceInterface (easytests.core.services.SubjectsServiceInterface)4 IssueStandardQuestionTypeOptionModelInterface (easytests.core.models.IssueStandardQuestionTypeOptionModelInterface)2 IssueStandardTopicPriorityModelInterface (easytests.core.models.IssueStandardTopicPriorityModelInterface)2 QuizModelInterface (easytests.core.models.QuizModelInterface)2 IssueStandardQuestionTypeOptionsServiceInterface (easytests.core.services.IssueStandardQuestionTypeOptionsServiceInterface)2 IssueStandardTopicPrioritiesServiceInterface (easytests.core.services.IssueStandardTopicPrioritiesServiceInterface)2 QuizzesServiceInterface (easytests.core.services.QuizzesServiceInterface)2 IssueEntity (easytests.core.entities.IssueEntity)1 IssueStandardEntity (easytests.core.entities.IssueStandardEntity)1 IssueModel (easytests.core.models.IssueModel)1 IssueStandardModel (easytests.core.models.IssueStandardModel)1 SubjectModel (easytests.core.models.SubjectModel)1