MCPcopy Index your code
hub / github.com/OpenFeign/feign / verifyTimes

Method verifyTimes

mock/src/main/java/feign/mock/MockClient.java:245–269  ·  view source on GitHub ↗
(final HttpMethod method, final String url, final int times)

Source from the content-addressed store, hash-verified

243 }
244
245 public List<Request> verifyTimes(final HttpMethod method, final String url, final int times) {
246 if (times < 0) {
247 throw new IllegalArgumentException("times must be a non negative number");
248 }
249
250 if (times == 0) {
251 verifyNever(method, url);
252 return Collections.emptyList();
253 }
254
255 RequestKey requestKey = RequestKey.builder(method, url).build();
256 if (!requests.containsKey(requestKey)) {
257 throw new VerificationAssertionError(
258 "Wanted: '%s' but never invoked! Got: %s", requestKey, requests.keySet());
259 }
260
261 List<Request> result = requests.get(requestKey);
262 if (result.size() != times) {
263 throw new VerificationAssertionError(
264 "Wanted: '%s' to be invoked: '%s' times but got: '%s'!",
265 requestKey, times, result.size());
266 }
267
268 return result;
269 }
270
271 public List<Request> verifyTimes(RequestKey requestKey, final int times) {
272 if (times < 0) {

Callers 6

verifyOneMethod · 0.95
verifyInvocationMethod · 0.80
verifyNoneMethod · 0.80
verifyNotInvokedMethod · 0.80
verifyNegativeMethod · 0.80

Calls 8

verifyNeverMethod · 0.95
builderMethod · 0.95
containsKeyMethod · 0.80
getMethod · 0.65
getValueMethod · 0.65
buildMethod · 0.45
sizeMethod · 0.45
equalsExtendedMethod · 0.45

Tested by 5

verifyInvocationMethod · 0.64
verifyNoneMethod · 0.64
verifyNotInvokedMethod · 0.64
verifyNegativeMethod · 0.64