Class OpenMock.MockBuilder<T>

java.lang.Object
cloud.opencode.base.test.OpenMock.MockBuilder<T>
Type Parameters:
T - the mock type | mock类型
Enclosing class:
OpenMock

public static class OpenMock.MockBuilder<T> extends Object
Mock Builder for fluent mock configuration 用于流畅mock配置的Mock构建器
Since:
JDK 25, opencode-base-test V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • thenReturn

      public OpenMock.MockBuilder<T> thenReturn(String methodName, Object returnValue)
      Stubs method to return value 桩方法返回值
      Parameters:
      methodName - the method name | 方法名
      returnValue - the return value | 返回值
      Returns:
      this builder | 此构建器
    • thenReturn

      public OpenMock.MockBuilder<T> thenReturn(String methodName, Object[] args, Object returnValue)
      Stubs method with specific args to return value 桩特定参数的方法返回值
      Parameters:
      methodName - the method name | 方法名
      args - the arguments | 参数
      returnValue - the return value | 返回值
      Returns:
      this builder | 此构建器
    • build

      public T build()
      Builds the mock 构建模拟
      Returns:
      the mock instance | 模拟实例