Package org.springframework.test.context.junit4.statements

# Class RunPrepareTestInstanceCallbacks

java.lang.Object
org.junit.runners.model.Statement
org.springframework.test.context.junit4.statements.RunPrepareTestInstanceCallbacks

public class RunPrepareTestInstanceCallbacks extends Statement
`RunPrepareTestInstanceCallbacks` is a custom JUnit `Statement` which allows the Spring TestContext Framework to be plugged into the JUnit execution chain by calling `prepareTestInstance()` on the supplied `TestContextManager`.

Since:
  4.2
Author:
  Sam Brannen
See Also:
  - `evaluate()`

## Constructor Summary

Constructors
Constructor
Description
`RunPrepareTestInstanceCallbacks(Statement next, Object testInstance, TestContextManager testContextManager)`
Construct a new `RunPrepareTestInstanceCallbacks` statement.

## Method Summary

Modifier and Type
Method
Description
`void`
`evaluate()`
Invoke `TestContextManager.prepareTestInstance(Object)` and then evaluate the next `Statement` in the execution chain (typically an instance of `RunAfterTestMethodCallbacks`).

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

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

## Constructor Details

### RunPrepareTestInstanceCallbacks

public RunPrepareTestInstanceCallbacks(Statement next, Object testInstance, TestContextManager testContextManager)
Construct a new `RunPrepareTestInstanceCallbacks` statement.

Parameters:
  `next` - the next `Statement` in the execution chain; never `null`
  `testInstance` - the current test instance; never `null`
  `testContextManager` - the `TestContextManager` upon which to call `prepareTestInstance()`; never `null`

## Method Details

### evaluate

public void evaluate() throws Throwable
Invoke `TestContextManager.prepareTestInstance(Object)` and then evaluate the next `Statement` in the execution chain (typically an instance of `RunAfterTestMethodCallbacks`).

Specified by:
  `evaluate` in class `Statement`
Throws:
  `Throwable`