use of easytests.core.entities.SolutionEntity in project easy-tests by malinink.
the class SolutionsServiceTest method testFindAllWithOptions.
@Test
public void testFindAllWithOptions() throws Exception {
final List<SolutionEntity> solutionsEntities = this.getSolutionsEntities();
final List<SolutionModelInterface> solutionsModels = this.getSolutionsModels(solutionsEntities);
final SolutionsOptionsInterface solutionsOptions = Mockito.mock(SolutionsOptionsInterface.class);
given(this.solutionsMapper.findAll()).willReturn(solutionsEntities);
given(solutionsOptions.withRelations(Mockito.anyList())).willReturn(solutionsModels);
final List<SolutionModelInterface> foundedSolutionsModels = this.solutionsService.findAll(solutionsOptions);
verify(solutionsOptions).withRelations(solutionsModels);
Assert.assertEquals(solutionsModels, foundedSolutionsModels);
}
use of easytests.core.entities.SolutionEntity in project easy-tests by malinink.
the class SolutionsServiceTest method createSolutionEntityMock.
private SolutionEntity createSolutionEntityMock(Integer id, Integer answerId, Integer pointId) {
final SolutionEntity solutionEntity = mock(SolutionEntity.class);
when(solutionEntity.getId()).thenReturn(id);
when(solutionEntity.getAnswerId()).thenReturn(answerId);
when(solutionEntity.getPointId()).thenReturn(pointId);
return solutionEntity;
}
use of easytests.core.entities.SolutionEntity in project easy-tests by malinink.
the class SolutionModelTest method testMap.
@Test
public void testMap() throws Exception {
final Integer id = 1;
final Integer sort = 1;
final Integer answerId = 2;
final Integer pointId = 3;
SolutionEntity solutionEntity = Mockito.mock(SolutionEntity.class);
Mockito.when(solutionEntity.getId()).thenReturn(id);
// Mockito.when(solutionEntity.getSort()).thenReturn(sort);
Mockito.when(solutionEntity.getAnswerId()).thenReturn(answerId);
Mockito.when(solutionEntity.getPointId()).thenReturn(pointId);
final SolutionModelInterface solutionModel = new SolutionModel();
solutionModel.map(solutionEntity);
Assert.assertEquals(id, solutionModel.getId());
// Assert.assertEquals(sort, solutionModel.getSort());
Assert.assertNull(solutionModel.getPoint());
Assert.assertNull(solutionModel.getAnswer());
}
Aggregations