Pageable page = new PageRequest(0, 10);
// search
userController.getAll(model, null, page, "NewUserName");
PageImpl userList = (PageImpl<User>) model.get("users");
assertThat(userList.getContent().size(), is(3));
// test to delete one
model.clear();
userController.delete(testUser, "NewUserId1", model);
model.clear();
userController.getAll(model, Role.USER, page, "NewUserName");
userList = (PageImpl<User>) model.get("users");
assertThat(userList.getContent().size(), is(2));
// test to delete more
model.clear();
userController.delete(testUser, "NewUserId2,NewUserId3", model);
model.clear();
userController.getAll(model, Role.USER, page, "NewUserName");
userList = (PageImpl<User>) model.get("users");
assertThat(userList.getContent().size(), is(0));
}