/** * Create a new request expectation that should be called a number of times * as indicated by {@code RequestCount}. * @param expectedCount the expected request expectedCount */ public DefaultRequestExpectation(ExpectedCount expectedCount, RequestMatcher requestMatcher) { Assert.notNull(expectedCount, "ExpectedCount is required"); Assert.notNull(requestMatcher, "RequestMatcher is required"); this.requestCount = new RequestCount(expectedCount); this.requestMatchers.add(requestMatcher); }
public void incrementAndValidate() { this.matchedRequestCount++; if (getMatchedRequestCount() > getExpectedCount().getMaxCount()) { throw new AssertionError("No more calls expected."); } }
@Override public boolean isSatisfied() { return getRequestCount().isSatisfied(); }
@Override public boolean isSatisfied() { return getRequestCount().isSatisfied(); }
public boolean hasRemainingCount() { return (getMatchedRequestCount() < getExpectedCount().getMaxCount()); }
@Override public boolean hasRemainingCount() { return getRequestCount().hasRemainingCount(); }
@Override public boolean hasRemainingCount() { return getRequestCount().hasRemainingCount(); }
public void incrementAndValidate() { this.matchedRequestCount++; if (getMatchedRequestCount() > getExpectedCount().getMaxCount()) { throw new AssertionError("No more calls expected."); } }
public boolean hasRemainingCount() { return (getMatchedRequestCount() < getExpectedCount().getMaxCount()); }
/** * Create a new request expectation that should be called a number of times * as indicated by {@code RequestCount}. * @param expectedCount the expected request expectedCount */ public DefaultRequestExpectation(ExpectedCount expectedCount, RequestMatcher requestMatcher) { Assert.notNull(expectedCount, "ExpectedCount is required"); Assert.notNull(requestMatcher, "RequestMatcher is required"); this.requestCount = new RequestCount(expectedCount); this.requestMatchers.add(requestMatcher); }
/** * Create a new request expectation that should be called a number of times * as indicated by {@code RequestCount}. * @param expectedCount the expected request expectedCount */ public DefaultRequestExpectation(ExpectedCount expectedCount, RequestMatcher requestMatcher) { Assert.notNull(expectedCount, "ExpectedCount is required"); Assert.notNull(requestMatcher, "RequestMatcher is required"); this.requestCount = new RequestCount(expectedCount); this.requestMatchers.add(requestMatcher); }
public void incrementAndValidate() { this.matchedRequestCount++; if (getMatchedRequestCount() > getExpectedCount().getMaxCount()) { throw new AssertionError("No more calls expected."); } }
public boolean isSatisfied() { // Only validate min count since max count is checked on every request... return (getMatchedRequestCount() >= getExpectedCount().getMinCount()); } }
public boolean isSatisfied() { // Only validate min count since max count is checked on every request... return (getMatchedRequestCount() >= getExpectedCount().getMinCount()); } }
@Override public void incrementAndValidate() { getRequestCount().incrementAndValidate(); }
@Override public ClientHttpResponse createResponse(ClientHttpRequest request) throws IOException { ResponseCreator responseCreator = getResponseCreator(); if (responseCreator == null) { throw new IllegalStateException("createResponse called before ResponseCreator was set"); } getRequestCount().incrementAndValidate(); return responseCreator.createResponse(request); }
@Override public boolean isSatisfied() { return getRequestCount().isSatisfied(); }
@Override public void incrementAndValidate() { getRequestCount().incrementAndValidate(); }
public boolean hasRemainingCount() { return (getMatchedRequestCount() < getExpectedCount().getMaxCount()); }
public boolean isSatisfied() { // Only validate min count since max count is checked on every request... return (getMatchedRequestCount() >= getExpectedCount().getMinCount()); } }