Search in sources :

Example 16 with IssueEntity

use of easytests.core.entities.IssueEntity 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

IssueEntity (easytests.core.entities.IssueEntity)16 IssueModelInterface (easytests.core.models.IssueModelInterface)6 Test (org.junit.Test)5 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)5 IssuesOptionsInterface (easytests.core.options.IssuesOptionsInterface)3 ArrayList (java.util.ArrayList)3 SubjectModelInterface (easytests.core.models.SubjectModelInterface)2 ModelsListEmpty (easytests.core.models.empty.ModelsListEmpty)1 SubjectModelEmpty (easytests.core.models.empty.SubjectModelEmpty)1 DeleteUnidentifiedModelException (easytests.core.services.exceptions.DeleteUnidentifiedModelException)1