IdeaService { public void voteForIdea(VoteCmd voteCmd, UserEntity voter) { Assert.notNull(voteCmd.getIdeaId(), "ideaId must not be null"); Assert.notNull(voter, "voter must not be null"); validateIdeaExists(voteCmd.getIdeaId()); final IdeaEntity idea = ideaRepository.findOne(voteCmd.getIdeaId()); votingService.voteForIdea(idea, ideasCampaignRepository.findOne(idea.getCampaignId()), voter, voteCmd.getVote()); }  IdeaOut fetchIdea(String ideaId, UserEntity requestor); Page<IdeaOut> fetchIdeasByStatus(String campaignId, Set<IdeaStatus> statusSet, Integer page, Integer pageSize, UserEntity requestor); Page<IdeaOut> fetchIdeasByRequestorHasVoted(String campaignId, boolean hasVoted, Integer page, Integer pageSize, UserEntity requestor); List<IdeaOut> fetchIdeasByCampaignAndCreator(String campaignId, UserEntity creator, UserEntity requestor); IdeaOut createNewIdea(String campaignId, IdeaIn cmd, UserEntity creator); IdeaOut modifyIdea(String ideaId, IdeaIn cmd, UserEntity requestingUser); void approveIdea(String campaignId, String ideaId, UserEntity approvingAdmin); void rejectIdea(String campaignId, String ideaId, String rejectionComment, UserEntity approvingAdmin); void voteForIdea(VoteCmd voteCmd, UserEntity voter);  }
@Test public void voteForIdea_shouldCallVotingService() { final IdeasCampaignEntity expectedCampaign = givenIdeaCampaignExists("test_campaignId", true); final IdeaEntity ideaEntity = givenIdeaExists(new IdeaIn("test_title", "test_pitch"), expectedCampaign.getId()); final UserEntity voter = givenUserEntity("testvoter_id"); ideaService.voteForIdea(new VoteCmd(ideaEntity.getId(), 1), voter); verify(votingService).voteForIdea(eq(ideaEntity), eq(expectedCampaign), eq(voter), eq(1)); }