use of easytests.core.options.UsersOptionsInterface in project easy-tests by malinink.
the class UsersServiceTest method testDeleteWithOptions.
@Test
public void testDeleteWithOptions() throws Exception {
final UserModelInterface userModel = Models.createUserModel(1, "FirstName", "LastName", "Surname", "email@gmail.com", "hash", true, 1);
final UsersOptionsInterface usersOptions = Mockito.mock(UsersOptionsInterface.class);
this.usersService.delete(userModel, usersOptions);
verify(usersOptions).deleteWithRelations(userModel);
}
use of easytests.core.options.UsersOptionsInterface in project easy-tests by malinink.
the class UsersServiceTest method testFindAllWithOptions.
@Test
public void testFindAllWithOptions() throws Exception {
final List<UserEntity> usersEntities = this.getUsersEntities();
final List<UserModelInterface> usersModels = this.getUsersModels();
final UsersOptionsInterface usersOptions = Mockito.mock(UsersOptionsInterface.class);
given(this.usersMapper.findAll()).willReturn(usersEntities);
given(usersOptions.withRelations(Mockito.anyList())).willReturn(usersModels);
final List<UserModelInterface> foundedUsersModels = this.usersService.findAll(usersOptions);
verify(usersOptions).withRelations(usersModels);
Assert.assertEquals(usersModels, foundedUsersModels);
}
use of easytests.core.options.UsersOptionsInterface in project easy-tests by malinink.
the class UsersServiceTest method testSaveWithOptions.
@Test
public void testSaveWithOptions() throws Exception {
final UserModelInterface userModel = Models.createUserModel(null, "FirstName", "LastName", "Surname", "email@gmail.com", "hash", true, 1);
final UsersOptionsInterface usersOptions = Mockito.mock(UsersOptionsInterface.class);
this.usersService.save(userModel, usersOptions);
verify(usersOptions).saveWithRelations(userModel);
}
Aggregations