Package org.jtalks.jcommune.web.dto

Examples of org.jtalks.jcommune.web.dto.PollOptionDto


        Poll poll = createPoll(POLL_ID, Arrays.asList(pollOptionId));

        Mockito.when(pollService.vote(POLL_ID, Arrays.asList(pollOptionId))).thenReturn(poll);

        PollDto pollDto = pollController.addSingleVote(POLL_ID, pollOptionId);
        PollOptionDto optionDto = pollDto.getPollOptions().get(0);

        Assert.assertEquals(pollDto.getId(), poll.getId(), "The id must be the same.");
        Assert.assertEquals(optionDto.getId(), pollOptionId, "The id must be the same");
    }
View Full Code Here


        Mockito.when(pollService.vote(POLL_ID, optionIds)).thenReturn(poll);

        PollDto resultPollDto = pollController.addMultipleVote(POLL_ID, pollDto);

        Assert.assertEquals(resultPollDto.getId(), poll.getId(), "The id must be the same.");
        PollOptionDto firstOptionDto = resultPollDto.getPollOptions().get(0);
        Assert.assertEquals(firstOptionDto.getId(), firstOptionId,
                "The id must be the same");
        PollOptionDto secondOptionDto = resultPollDto.getPollOptions().get(1);
        Assert.assertEquals(secondOptionDto.getId(), secondOptionId,
                "The id must be the same");

    }
View Full Code Here

TOP

Related Classes of org.jtalks.jcommune.web.dto.PollOptionDto

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.