Interface TestInstances
- All Known Implementing Classes:
DefaultTestInstances
-
Method Summary
Modifier and TypeMethodDescription<T> Optional
<T> findInstance
(Class<T> requiredType) Find the first test instance that is an instance of the supplied required type, checking from innermost to outermost.Get all test instances, ordered from outermost to innermost.Get the enclosing test instances, excluding the innermost test instance, ordered from outermost to innermost.Get the innermost test instance.
-
Method Details
-
getInnermostInstance
Object getInnermostInstance()Get the innermost test instance.The innermost instance is the one closest to the test method.
- Returns:
- the innermost test instance; never
null
-
getEnclosingInstances
-
getAllInstances
-
findInstance
Find the first test instance that is an instance of the supplied required type, checking from innermost to outermost.- Parameters:
requiredType
- the type to search for- Returns:
- the first test instance of the required type; never
null
but potentially empty
-