use of easytests.core.entities.SolutionEntity in project easy-tests by malinink.
the class SolutionsMapperTest method testFindByPointId.
@Test
public void testFindByPointId() throws Exception {
final List<SolutionEntity> solutionsFixtureEntities = new ArrayList<>();
solutionsFixtureEntities.add(this.solutionsSupport.getEntityFixtureMock(0));
solutionsFixtureEntities.add(this.solutionsSupport.getEntityFixtureMock(1));
final List<SolutionEntity> solutionFoundedEntities = this.solutionsMapper.findByPointId(1);
Assert.assertEquals(2, solutionFoundedEntities.size());
Integer index = 0;
for (SolutionEntity solutionEntity : solutionFoundedEntities) {
this.solutionsSupport.assertEquals(solutionsFixtureEntities.get(index), solutionEntity);
index++;
}
}
use of easytests.core.entities.SolutionEntity in project easy-tests by malinink.
the class SolutionsServiceTest method testFindPresentModel.
@Test
public void testFindPresentModel() throws Exception {
Integer id = 1;
final SolutionEntity solutionEntity = this.createSolutionEntityMock(id, 2, 3);
given(this.solutionsMapper.find(id)).willReturn(solutionEntity);
final SolutionModelInterface solutionModel = this.solutionsService.find(id);
Assert.assertNotNull(solutionModel);
Assert.assertEquals(solutionModel, this.mapSolutionModel(solutionEntity));
}
use of easytests.core.entities.SolutionEntity in project easy-tests by malinink.
the class SolutionsServiceTest method mapSolutionEntity.
private SolutionEntity mapSolutionEntity(SolutionModelInterface solutionModel) {
final SolutionEntity solutionEntity = new SolutionEntity();
solutionEntity.map(solutionModel);
return solutionEntity;
}
use of easytests.core.entities.SolutionEntity in project easy-tests by malinink.
the class SolutionsServiceTest method testFindWithOptions.
@Test
public void testFindWithOptions() throws Exception {
final Integer id = 1;
final SolutionEntity solutionEntity = this.createSolutionEntityMock(id, 1, 1);
final SolutionModelInterface solutionModel = this.mapSolutionModel(solutionEntity);
final SolutionsOptionsInterface solutionsOptions = Mockito.mock(SolutionsOptionsInterface.class);
given(this.solutionsMapper.find(id)).willReturn(solutionEntity);
given(solutionsOptions.withRelations(solutionModel)).willReturn(solutionModel);
final SolutionModelInterface foundedSolutionModel = this.solutionsService.find(id, solutionsOptions);
Assert.assertEquals(solutionModel, foundedSolutionModel);
verify(solutionsOptions).withRelations(solutionModel);
}
use of easytests.core.entities.SolutionEntity in project easy-tests by malinink.
the class SolutionsService method delete.
@Override
public void delete(SolutionModelInterface solutionModel) {
final SolutionEntity solutionEntity = this.map(solutionModel);
if (solutionEntity.getId() == null) {
throw new DeleteUnidentifiedModelException();
}
this.solutionsMapper.delete(solutionEntity);
}
Aggregations