* @throws EnMeExpcetion
*/
@Test
public void testRegisterAccessRateVotedLike() throws EnMeNoResultsFoundException, EnMeExpcetion{
final Question question = createQuestion("Who are you?", "");
final TweetPoll tp = createPublishedTweetPoll(getSpringSecurityLoggedUserAccount().getAccount(), question);
final String ipAddress = "192.168.1.81";
flushIndexes();
// I like it vote.
final AccessRate rate = getFrontEndService().registerAccessRate(
TypeSearchResult.TWEETPOLL,
tp.getTweetPollId(),
ipAddress,
Boolean.TRUE);
Assert.assertNotNull(rate);
// I like it vote again.
String ipAddress2 = "192.168.1.82";
final AccessRate rate2 = getFrontEndService().registerAccessRate(
TypeSearchResult.TWEETPOLL,
tp.getTweetPollId(),
ipAddress2,
Boolean.TRUE);
Assert.assertNotNull(rate2);
// I don't like it vote.
final AccessRate rate3 = getFrontEndService().registerAccessRate(
TypeSearchResult.TWEETPOLL,
tp.getTweetPollId(),
ipAddress,
Boolean.FALSE);
Assert.assertNotNull(rate3);
}