Interface TestInstances

    • Method Detail

      • getInnermostInstance

        Object getInnermostInstance()
        Get the innermost test instance.

        The innermost instance is the one closest to the test method.

        the innermost test instance; never null
      • getEnclosingInstances

        List<Object> getEnclosingInstances()
        Get the enclosing test instances, excluding the innermost test instance, ordered from outermost to innermost.
        the enclosing test instances; never null or containing null, but potentially empty
      • getAllInstances

        List<Object> getAllInstances()
        Get all test instances, ordered from outermost to innermost.
        all test instances; never null, containing null, or empty
      • findInstance

        <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.
        requiredType - the type to search for
        the first test instance of the required type; never null but potentially empty