use of easytests.core.entities.TesteeEntity in project easy-tests by malinink.
the class TesteesMapperTest method testFind.
@Test
public void testFind() throws Exception {
final TesteeEntity testee = this.testeesMapper.find(1);
Assert.assertEquals((long) 1, (long) testee.getId());
Assert.assertEquals("FirstName1", testee.getFirstName());
Assert.assertEquals("LastName1", testee.getLastName());
Assert.assertEquals("Surname1", testee.getSurname());
Assert.assertEquals((long) 1, (long) testee.getQuizId());
}
use of easytests.core.entities.TesteeEntity in project easy-tests by malinink.
the class TesteesMapperTest method testUpdate.
@Test
public void testUpdate() throws Exception {
final Integer id = 1;
final String firstName = "NewFirstName";
final String lastName = "NewLastName";
final String surname = "NewSurname";
final Integer groupNumber = 308;
final Integer quizId = 19;
TesteeEntity testeeEntity = this.testeesMapper.find(id);
Assert.assertNotNull(testeeEntity);
Assert.assertEquals(id, testeeEntity.getId());
Assert.assertNotEquals(firstName, testeeEntity.getFirstName());
Assert.assertNotEquals(lastName, testeeEntity.getLastName());
Assert.assertNotEquals(surname, testeeEntity.getSurname());
Assert.assertNotEquals(groupNumber, testeeEntity.getGroupNumber());
Assert.assertNotEquals(quizId, testeeEntity.getQuizId());
testeeEntity = Mockito.mock(TesteeEntity.class);
Mockito.when(testeeEntity.getId()).thenReturn(id);
Mockito.when(testeeEntity.getFirstName()).thenReturn(firstName);
Mockito.when(testeeEntity.getLastName()).thenReturn(lastName);
Mockito.when(testeeEntity.getSurname()).thenReturn(surname);
Mockito.when(testeeEntity.getGroupNumber()).thenReturn(groupNumber);
Mockito.when(testeeEntity.getQuizId()).thenReturn(quizId);
this.testeesMapper.update(testeeEntity);
testeeEntity = this.testeesMapper.find(id);
Assert.assertEquals(id, testeeEntity.getId());
Assert.assertEquals(firstName, testeeEntity.getFirstName());
Assert.assertEquals(lastName, testeeEntity.getLastName());
Assert.assertEquals(surname, testeeEntity.getSurname());
Assert.assertEquals(groupNumber, testeeEntity.getGroupNumber());
Assert.assertEquals(quizId, testeeEntity.getQuizId());
}
use of easytests.core.entities.TesteeEntity in project easy-tests by malinink.
the class TesteesSupport method getEntityMock.
private TesteeEntity getEntityMock(Integer id, String firstName, String lastName, String surName, Integer groupNumber, Integer quizId) {
TesteeEntity testeeEntity = Mockito.mock(TesteeEntity.class);
Mockito.when(testeeEntity.getId()).thenReturn(id);
Mockito.when(testeeEntity.getFirstName()).thenReturn(firstName);
Mockito.when(testeeEntity.getLastName()).thenReturn(lastName);
Mockito.when(testeeEntity.getSurname()).thenReturn(surName);
Mockito.when(testeeEntity.getGroupNumber()).thenReturn(groupNumber);
Mockito.when(testeeEntity.getQuizId()).thenReturn(quizId);
return testeeEntity;
}
use of easytests.core.entities.TesteeEntity in project easy-tests by malinink.
the class TesteesSupport method assetEntityListEquals.
public void assetEntityListEquals(List<TesteeEntity> expected, List<TesteeEntity> actual) {
Assert.assertEquals(expected.size(), actual.size());
Integer i = 0;
for (TesteeEntity testeeEntity : expected) {
this.assertEquals(testeeEntity, actual.get(i));
i++;
}
}
use of easytests.core.entities.TesteeEntity in project easy-tests by malinink.
the class TesteesService method delete.
@Override
public void delete(TesteeModelInterface testeeModel) {
final TesteeEntity testeeEntity = this.map(testeeModel);
if (testeeEntity.getId() == null) {
throw new DeleteUnidentifiedModelException();
}
this.testeesMapper.delete(testeeEntity);
}
Aggregations