Using Matcher in EasyMock

When we use EasyMock test to expect some methods and such methods have more than one parameters we might use EasyMock Matcher such as isA, eq. (The line highlight below)
In this case either Matcher is used for all parameters or no Matcher used for all parameters. Both are right.
Only part of parameters using Matcher will result errors as:
java.lang.IllegalStateException: 3 matchers expected, 1 recorded. in the next line

        expect(reviewerService.getCurrentReviewerId()).andReturn(reviewerID);
        expect(pageConfiguration.getPageSize()).andReturn(count);
        expect(ratingsAndReviewsService.countResults(isA(FilterCriteria.class))).andReturn(count);
        expect(dateTimeService.getDateTime()).andReturn(date);
        expect(ratingsAndReviewsService.getResultsPage(isA(FilterCriteria.class), eq(0), eq(2))).andReturn(ratingReviews);
        expect(dateTimeService.getDateTime()).andReturn(date);        expect(ratingsAndReviewsService.getReviewerReviewCounts(reviewerID,RatingReviewStatus.LIVE)).andReturn(1);    expect(ratingsAndReviewsService.getReviewerReviewCounts(reviewerID,RatingReviewStatus.IN_MODERATION)).andReturn(2);    expect(ratingsAndReviewsService.getReviewerReviewCounts(reviewerID,RatingReviewStatus.DECLINED)).andReturn(3);    expect(ratingsAndReviewsService.getReviewerReviewCounts(reviewerID,RatingReviewStatus.REMOVED)).andReturn(4);   expect(ratingsAndReviewsService.countReviewerReportedReviews(reviewerID)).andReturn(5);

你可能感兴趣的:(easymock)