use of easytests.core.models.empty.UserModelEmpty in project easy-tests by malinink.
the class SubjectsSupport method assertEquals.
public void assertEquals(SubjectEntity expected, SubjectModelInterface actual) {
assertEquals(actual, expected);
Assert.assertEquals(new UserModelEmpty(expected.getUserId()), actual.getUser());
Assert.assertEquals(new ModelsListEmpty(), actual.getTopics());
Assert.assertEquals(new IssueStandardModelEmpty(), actual.getIssueStandard());
Assert.assertEquals(new ModelsListEmpty(), actual.getIssues());
}
use of easytests.core.models.empty.UserModelEmpty in project easy-tests by malinink.
the class SubjectsServiceTest method testSaveModel.
@Test
public void testSaveModel() throws Exception {
final SubjectModelInterface subjectModel = new SubjectModel();
subjectModel.setName("test111");
subjectModel.setTopics(new ModelsListEmpty());
subjectModel.setIssueStandard(new IssueStandardModelEmpty());
subjectModel.setUser(new UserModelEmpty(1));
subjectModel.setIssues(new ModelsListEmpty());
this.subjectsService.save(subjectModel);
final SubjectModelInterface foundedSubjectModel = this.subjectsService.find(subjectModel.getId());
Assert.assertEquals(subjectModel, foundedSubjectModel);
}
use of easytests.core.models.empty.UserModelEmpty in project easy-tests by malinink.
the class SubjectModel method map.
public void map(SubjectEntity subjectEntity) {
this.setId(subjectEntity.getId());
this.setName(subjectEntity.getName());
this.setDescription(subjectEntity.getDescription());
this.setTopics(new ModelsListEmpty());
this.setUser(new UserModelEmpty(subjectEntity.getUserId()));
this.setIssueStandard(new IssueStandardModelEmpty());
this.setIssues(new ModelsListEmpty());
}
use of easytests.core.models.empty.UserModelEmpty in project easy-tests by malinink.
the class SubjectModelTest method testMap.
@Test
public void testMap() throws Exception {
final Integer subjectId = 5;
final String subjectName = "Test subject";
final String subjectDescription = "Test subject description";
final Integer subjectUserId = 3;
final SubjectEntity subjectEntity = Mockito.mock(SubjectEntity.class);
Mockito.when(subjectEntity.getId()).thenReturn(subjectId);
Mockito.when(subjectEntity.getName()).thenReturn(subjectName);
Mockito.when(subjectEntity.getDescription()).thenReturn(subjectDescription);
Mockito.when(subjectEntity.getUserId()).thenReturn(subjectUserId);
final SubjectModelInterface subjectModel = new SubjectModel();
subjectModel.map(subjectEntity);
Assert.assertEquals(subjectId, subjectModel.getId());
Assert.assertEquals(subjectName, subjectModel.getName());
Assert.assertEquals(subjectDescription, subjectModel.getDescription());
Assert.assertEquals(new ModelsListEmpty(), subjectModel.getTopics());
Assert.assertEquals(new UserModelEmpty(subjectUserId), subjectModel.getUser());
Assert.assertEquals(new IssueStandardModelEmpty(), subjectModel.getIssueStandard());
Assert.assertEquals(new ModelsListEmpty(), subjectModel.getIssues());
}
use of easytests.core.models.empty.UserModelEmpty in project easy-tests by malinink.
the class SubjectEntityTest method testMap.
@Test
public void testMap() throws Exception {
final Integer subjectId = 5;
final String subjectName = "Test subject";
final Integer subjectUserId = 1;
final SubjectModelInterface subjectModel = Mockito.mock(SubjectModelInterface.class);
Mockito.when(subjectModel.getId()).thenReturn(subjectId);
Mockito.when(subjectModel.getName()).thenReturn(subjectName);
Mockito.when(subjectModel.getTopics()).thenReturn(new ModelsListEmpty());
Mockito.when(subjectModel.getUser()).thenReturn(new UserModelEmpty(subjectUserId));
Mockito.when(subjectModel.getIssueStandard()).thenReturn(new IssueStandardModelEmpty());
Mockito.when(subjectModel.getIssues()).thenReturn(new ModelsListEmpty());
final SubjectEntity subjectEntity = new SubjectEntity();
subjectEntity.map(subjectModel);
Assert.assertEquals(subjectId, subjectEntity.getId());
Assert.assertEquals(subjectName, subjectEntity.getName());
Assert.assertEquals(subjectUserId, subjectEntity.getUserId());
}
Aggregations