class LooseExpectation
extends Object
Expects demanded call cardinalities to match demanded ranges. The calls are allowed to be out of the recorded sequence. If a method is demanded multiple times, the ranges are filled by order of recording.
| Constructor and description |
|---|
LooseExpectation(Demand demand)Creates a loose expectation backed by the supplied demand definition. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
boolean |
isEligible(String name, int i)Determines whether the recorded demand at the supplied index can satisfy the current call. |
|
Closure |
match(String name)Match the requested method name against eligible demands. |
|
void |
verify()verify all calls are in expected range |
Per-demand invocation counters used during verification.
Demand definition being matched.
Creates a loose expectation backed by the supplied demand definition.
demand - the recorded demand specificationDetermines whether the recorded demand at the supplied index can satisfy the current call.
name - the requested method namei - the index of the candidate demandtrue when the demand matches and remains within its allowed rangeMatch the requested method name against eligible demands. Fail early if no match possible. Return the demand's behavior closure on match. Also skips over names matching ignore filter, if any.
verify all calls are in expected range
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.