use of org.survey.model.poll.Poll in project survey by markoniemi.
the class PollServiceTestBase method findOne.
@Test
public void findOne() {
create();
for (int i = 0; i < ENTITY_COUNT; i++) {
Poll originalEntity = orginalEntities.get(i);
Poll foundEntity = entityService.findOne(originalEntity.getName());
assertEntity(orginalEntities.get(i), foundEntity);
}
// TODO how to test a non-existent entity?
}
use of org.survey.model.poll.Poll in project survey by markoniemi.
the class PollServiceTestBase method exists.
@Test
public void exists() {
create();
for (int i = 0; i < ENTITY_COUNT; i++) {
Poll entity = orginalEntities.get(i);
entityService.exists(entity.getName());
}
// TODO how to test if exists fails?
// Assert.assertFalse(entityRepository.exists((ID) new Object()));
}
use of org.survey.model.poll.Poll in project survey by markoniemi.
the class PollServiceTestBase method delete.
@Test
public void delete() {
create();
for (int i = 0; i < ENTITY_COUNT; i++) {
Poll entity = orginalEntities.get(i);
entityService.delete(entity.getName());
Assert.assertFalse(entityService.exists(entity.getName()));
}
Assert.assertEquals(0, entityService.count());
}
use of org.survey.model.poll.Poll in project survey by markoniemi.
the class PollRepositoryTest method findAllByOwner.
@Test
public void findAllByOwner() {
save();
Poll originalPoll = orginalEntities.get(0);
@SuppressWarnings("unchecked") List<Poll> polls = IteratorUtils.toList(pollRepository.findAllByOwner(originalPoll.getOwner()).iterator());
Assert.assertEquals(ENTITY_COUNT, polls.size());
// Assert.assertEquals(0, entityComparator.compare(originalPoll, polls.get(0)));
}
use of org.survey.model.poll.Poll in project survey by markoniemi.
the class PollRepositoryTest method findByName.
@Test
public void findByName() {
save();
Poll originalPoll = orginalEntities.get(0);
Poll poll = (pollRepository.findByName(originalPoll.getName()));
Assert.assertEquals(0, entityComparator.compare(originalPoll, poll));
}
Aggregations