use of easytests.core.entities.TesteeEntity in project easy-tests by malinink.
the class TesteesMapperTest method testFindAll.
@Test
public void testFindAll() throws Exception {
final List<TesteeEntity> testeesFoundedEntities = this.testeesMapper.findAll();
Assert.assertEquals(3, testeesFoundedEntities.size());
Integer index = 0;
for (TesteeEntity testeeEntity : testeesFoundedEntities) {
final TesteeEntity testeeFixtureEntity = this.testeesSupport.getEntityFixtureMock(index);
this.testeesSupport.assertEquals(testeeFixtureEntity, testeeEntity);
index++;
}
}
use of easytests.core.entities.TesteeEntity in project easy-tests by malinink.
the class TesteesServiceTest method testFindPresentModel.
@Test
public void testFindPresentModel() throws Exception {
final Integer id = 1;
final TesteeEntity testeeEntity = Entities.createTesteeEntityMock(id, "NewFirstName", "NewLastName1", "NewSurname1", 307, 7);
given(this.testeesMapper.find(id)).willReturn(testeeEntity);
final TesteeModelInterface testeeModel = this.testeesService.find(id);
Assert.assertEquals(this.mapTesteeModel(testeeEntity), testeeModel);
}
use of easytests.core.entities.TesteeEntity in project easy-tests by malinink.
the class TesteesServiceTest method mapTesteeEntity.
private TesteeEntity mapTesteeEntity(TesteeModelInterface testeeModel) {
final TesteeEntity testeeEntity = new TesteeEntity();
testeeEntity.map(testeeModel);
return testeeEntity;
}
use of easytests.core.entities.TesteeEntity in project easy-tests by malinink.
the class TesteesServiceTest method getTesteesEntities.
private List<TesteeEntity> getTesteesEntities() {
final List<TesteeEntity> testeesEntities = new ArrayList<>(2);
final TesteeEntity testeeEntityFirst = Entities.createTesteeEntityMock(1, "FirstName1", "LastName1", "Surname1", 301, 1);
final TesteeEntity testeeEntitySecond = Entities.createTesteeEntityMock(2, "FirstName2", "LastName2", "Surname2", 302, 2);
testeesEntities.add(testeeEntityFirst);
testeesEntities.add(testeeEntitySecond);
return testeesEntities;
}
use of easytests.core.entities.TesteeEntity in project easy-tests by malinink.
the class TesteesServiceTest method testSaveCreatesEntity.
@Test
public void testSaveCreatesEntity() throws Exception {
final TesteeModelInterface testeeModel = Models.createTesteeModel(null, "FirstName", "LastName", "Surname", 301, 1);
doAnswer(invocation -> {
final TesteeEntity testeeEntity = (TesteeEntity) invocation.getArguments()[0];
testeeEntity.setId(5);
return null;
}).when(this.testeesMapper).insert(Mockito.any(TesteeEntity.class));
this.testeesService.save(testeeModel);
verify(this.testeesMapper, times(1)).insert(this.mapTesteeEntity(testeeModel));
Assert.assertEquals((Integer) 5, testeeModel.getId());
}
Aggregations