Class OpenMock.Verification<T>
java.lang.Object
cloud.opencode.base.test.OpenMock.Verification<T>
- Type Parameters:
T- the mock type | mock类型
- Enclosing class:
OpenMock
Verification wrapper for asserting mock invocations
用于断言mock调用的验证包装器
- Since:
- JDK 25, opencode-base-test V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionGets all invocations 获取所有调用intinvocationCount(String methodName) Gets the invocation count for a method 获取方法的调用次数wasInvoked(String methodName) Verifies method was invoked 验证方法被调用wasInvoked(String methodName, int times) Verifies method was invoked exactly N times 验证方法被调用恰好N次wasNeverInvoked(String methodName) Verifies method was never invoked 验证方法从未被调用
-
Method Details
-
wasInvoked
Verifies method was invoked 验证方法被调用- Parameters:
methodName- the method name | 方法名- Returns:
- this verification | 此验证
-
wasInvoked
Verifies method was invoked exactly N times 验证方法被调用恰好N次- Parameters:
methodName- the method name | 方法名times- the expected times | 期望次数- Returns:
- this verification | 此验证
-
wasNeverInvoked
Verifies method was never invoked 验证方法从未被调用- Parameters:
methodName- the method name | 方法名- Returns:
- this verification | 此验证
-
invocationCount
Gets the invocation count for a method 获取方法的调用次数- Parameters:
methodName- the method name | 方法名- Returns:
- the count | 次数
-
getAllInvocations
Gets all invocations 获取所有调用- Returns:
- the invocations | 调用列表
-