Package org.springframework.test.context.bean.override.mockito

# Class MockitoResetTestExecutionListener

java.lang.Object
org.springframework.test.context.support.AbstractTestExecutionListener
org.springframework.test.context.bean.override.mockito.MockitoResetTestExecutionListener

All Implemented Interfaces:
  `org.springframework.core.Ordered`, `TestExecutionListener`

public class MockitoResetTestExecutionListener extends AbstractTestExecutionListener
`TestExecutionListener` that resets any mock beans that have been marked with a `MockReset`.

Since:
  6.2
Author:
  Phillip Webb, Sam Brannen
See Also:
  - `@MockitoBean`
  - `@MockitoSpyBean`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`ORDER`
The `order` value for this listener (`Ordered.LOWEST_PRECEDENCE - 100`): 2147483547.

### Fields inherited from interface org.springframework.core.Ordered

`HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

## Constructor Summary

Constructors
Constructor
Description
`MockitoResetTestExecutionListener()`

## Method Summary

Modifier and Type
Method
Description
`void`
`afterTestMethod(TestContext testContext)`
The default implementation is empty.
`void`
`beforeTestMethod(TestContext testContext)`
The default implementation is empty.
`int`
`getOrder()`
Returns 2147483547, which ensures that the `MockitoResetTestExecutionListener` is ordered after all standard `TestExecutionListener` implementations.

### Methods inherited from class org.springframework.test.context.support.AbstractTestExecutionListener

`afterTestClass, afterTestExecution, beforeTestClass, beforeTestExecution, prepareTestInstance`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### ORDER

public static final int ORDER
The `order` value for this listener (`Ordered.LOWEST_PRECEDENCE - 100`): 2147483547.

Since:
  6.2.3
See Also:
  - Constant Field Values

## Constructor Details

### MockitoResetTestExecutionListener

public MockitoResetTestExecutionListener()

## Method Details

### getOrder

public int getOrder()
Returns 2147483547, which ensures that the `MockitoResetTestExecutionListener` is ordered after all standard `TestExecutionListener` implementations.

Specified by:
  `getOrder` in interface `org.springframework.core.Ordered`
Overrides:
  `getOrder` in class `AbstractTestExecutionListener`
See Also:
  - `ORDER`

### beforeTestMethod

public void beforeTestMethod(TestContext testContext)
Description copied from class: `AbstractTestExecutionListener`
The default implementation is empty. Can be overridden by subclasses as necessary.

Specified by:
  `beforeTestMethod` in interface `TestExecutionListener`
Overrides:
  `beforeTestMethod` in class `AbstractTestExecutionListener`
Parameters:
  `testContext` - the test context in which the test method will be executed; never `null`
See Also:
  - `TestExecutionListener.afterTestMethod(org.springframework.test.context.TestContext)`
  - `TestExecutionListener.beforeTestExecution(org.springframework.test.context.TestContext)`
  - `TestExecutionListener.afterTestExecution(org.springframework.test.context.TestContext)`

### afterTestMethod

public void afterTestMethod(TestContext testContext)
Description copied from class: `AbstractTestExecutionListener`
The default implementation is empty. Can be overridden by subclasses as necessary.

Specified by:
  `afterTestMethod` in interface `TestExecutionListener`
Overrides:
  `afterTestMethod` in class `AbstractTestExecutionListener`
Parameters:
  `testContext` - the test context in which the test method was executed; never `null`
See Also:
  - `TestExecutionListener.beforeTestMethod(org.springframework.test.context.TestContext)`
  - `TestExecutionListener.beforeTestExecution(org.springframework.test.context.TestContext)`
  - `TestExecutionListener.afterTestExecution(org.springframework.test.context.TestContext)`