private void updateInternal(RequestExpectation expectation) { if (expectation.hasRemainingCount()) { this.expectations.add(expectation); } else { this.expectations.remove(expectation); } }
@Test public void hasRemainingCount() { RequestExpectation expectation = new DefaultRequestExpectation(twice(), requestTo("/foo")); expectation.andRespond(withSuccess()); expectation.incrementAndValidate(); assertTrue(expectation.hasRemainingCount()); expectation.incrementAndValidate(); assertFalse(expectation.hasRemainingCount()); }
private void updateInternal(RequestExpectation expectation) { if (expectation.hasRemainingCount()) { this.expectations.add(expectation); } else { this.expectations.remove(expectation); } }
/** * Invoke this for an expectation that has been matched. * <p>The given expectation will either be stored if it has a remaining * count or it will be removed otherwise. */ public void update(RequestExpectation expectation) { if (expectation.hasRemainingCount()) { getExpectations().add(expectation); } else { getExpectations().remove(expectation); } }