use of easytests.core.models.TesteeModelInterface in project easy-tests by malinink.
the class TesteesServiceTest method testSaveWithOptions.
@Test
public void testSaveWithOptions() throws Exception {
final TesteeModelInterface testeeModel = Models.createTesteeModel(null, "FirstName", "LastName", "Surname", 301, 1);
final TesteesOptionsInterface testeesOptions = Mockito.mock(TesteesOptionsInterface.class);
this.testeesService.save(testeeModel, testeesOptions);
verify(testeesOptions).saveWithRelations(testeeModel);
}
use of easytests.core.models.TesteeModelInterface in project easy-tests by malinink.
the class TesteesServiceTest method testDeleteWithOptions.
@Test
public void testDeleteWithOptions() throws Exception {
final TesteeModelInterface testeeModel = Models.createTesteeModel(1, "FirstName", "LastName", "Surname", 301, 1);
final TesteesOptionsInterface testeesOptions = Mockito.mock(TesteesOptionsInterface.class);
this.testeesService.delete(testeeModel, testeesOptions);
verify(testeesOptions).deleteWithRelations(testeeModel);
}
use of easytests.core.models.TesteeModelInterface in project easy-tests by malinink.
the class TesteesServiceTest method testFindAllWithOptions.
@Test
public void testFindAllWithOptions() throws Exception {
final List<TesteeEntity> testeesEntities = this.getTesteesEntities();
final List<TesteeModelInterface> testeesModels = this.getTesteesModels();
final TesteesOptionsInterface testeesOptions = Mockito.mock(TesteesOptionsInterface.class);
given(this.testeesMapper.findAll()).willReturn(testeesEntities);
given(testeesOptions.withRelations(Mockito.anyList())).willReturn(testeesModels);
final List<TesteeModelInterface> foundedTesteesModels = this.testeesService.findAll(testeesOptions);
verify(testeesOptions).withRelations(testeesModels);
Assert.assertEquals(testeesModels, foundedTesteesModels);
}
use of easytests.core.models.TesteeModelInterface in project easy-tests by malinink.
the class TesteesServiceTest method testDeleteIdentifiedModel.
@Test
public void testDeleteIdentifiedModel() throws Exception {
final TesteeModelInterface testeeModel = Models.createTesteeModel(1, "FirstName", "LastName", "Surname", 301, 1);
this.testeesService.delete(testeeModel);
verify(this.testeesMapper, times(1)).delete(this.mapTesteeEntity(testeeModel));
}
use of easytests.core.models.TesteeModelInterface in project easy-tests by malinink.
the class TesteesServiceTest method testFindAbsentModel.
@Test
public void testFindAbsentModel() throws Exception {
final Integer id = 10;
given(this.testeesMapper.find(id)).willReturn(null);
final TesteeModelInterface testeeModel = this.testeesService.find(id);
Assert.assertEquals(null, testeeModel);
}
Aggregations