assertEquals("TOMEE_JUG", subject.getName());
}
@Test
public void playWithVotes() {
Subject subject = subjectDao.create("TOMEE_JUG_2", "What do you think about this JUG?");
final Vote vote = voteDao.create(Value.I_LIKE);
subject = subjectDao.addVote(subject, vote);
assertEquals(1, subject.getVotes().size());
final Vote moreVote = voteDao.create(Value.I_LIKE);
subject = subjectDao.addVote(subject, moreVote);
assertEquals(2, subject.getVotes().size());
final Vote notLiked = voteDao.create(Value.I_DONT_LIKE);
subject = subjectDao.addVote(subject, notLiked);
assertEquals(3, subject.getVotes().size());
final Subject retrievedSubject = subjectDao.findByName("TOMEE_JUG_2");
assertNotNull(retrievedSubject);
assertNotNull(retrievedSubject.getVotes());
assertEquals(3, retrievedSubject.getVotes().size());
}