IdeaService { public IdeaOut modifyIdea(String ideaId, IdeaIn cmd, UserEntity requestingUser) { Assert.notNull(cmd, "cmd must not be null."); Assert.hasText(ideaId, "ideaId must not be null."); Assert.notNull(requestingUser, "user must not be null."); validateIdeaExists(ideaId); final IdeaEntity existingIdea = ideaRepository.findOne(ideaId); checkRequestorIsOwner(requestingUser, existingIdea); existingIdea.getContentI18n().getOriginal().setPitch(cmd.getPitch()); return new IdeaOut(ideaRepository.save(existingIdea)); }  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(expected = ResourceNotFoundException.class) public void updateIdea_shouldThrowException_OnNotExistingIdea() { final String missingIdeaId = "idea27"; givenIdeaDoesntExist(missingIdeaId); ideaService.modifyIdea(missingIdeaId, new IdeaIn("test_title", "my faulty pitch"), new UserEntity()); }