Enum Class MockReset

java.lang.Object
java.lang.Enum<MockReset>
cn.taketoday.framework.test.mock.mockito.MockReset
所有已实现的接口:
Serializable, Comparable<MockReset>, Constable

public enum MockReset extends Enum<MockReset>
Reset strategy used on a mock bean. Usually applied to a mock via the @MockBean annotation but can also be directly applied to any mock in the ApplicationContext using the static methods.
从以下版本开始:
4.0
作者:
Phillip Webb
另请参阅:
  • 枚举常量详细资料

    • BEFORE

      public static final MockReset BEFORE
      Reset the mock before the test method runs.
    • AFTER

      public static final MockReset AFTER
      Reset the mock after the test method runs.
    • NONE

      public static final MockReset NONE
      Don't reset the mock.
  • 构造器详细资料

    • MockReset

      private MockReset()
  • 方法详细资料

    • values

      public static MockReset[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      返回:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MockReset valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      参数:
      name - 要返回的枚举常量的名称。
      返回:
      返回带有指定名称的枚举常量
      抛出:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - 如果参数为空值
    • before

      public static org.mockito.MockSettings before()
      Create settings to be used with mocks where reset should occur before each test method runs.
      返回:
      mock settings
    • after

      public static org.mockito.MockSettings after()
      Create settings to be used with mocks where reset should occur after each test method runs.
      返回:
      mock settings
    • withSettings

      public static org.mockito.MockSettings withSettings(MockReset reset)
      Create settings to be used with mocks where a specific reset should occur.
      参数:
      reset - the reset type
      返回:
      mock settings
    • apply

      public static org.mockito.MockSettings apply(MockReset reset, org.mockito.MockSettings settings)
      Apply MockReset to existing settings.
      参数:
      reset - the reset type
      settings - the settings
      返回:
      the configured settings
    • get

      static MockReset get(Object mock)
      Get the MockReset associated with the given mock.
      参数:
      mock - the source mock
      返回:
      the reset type (never null)