Class MethodContext

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.junit.jupiter.api.extension.ExtensionContext

    public class MethodContext
    extends AbstractContext
    Represent feature level (test method level). In case of test iterations (data-driven) each iteration will have its own context (required to renew extension instances).

    Based on org.junit.jupiter.engine.descriptor.MethodExtensionContext from junit-jupiter-engine.

    Since:
    20.12.2021
    • Constructor Detail

      • MethodContext

        public MethodContext​(ClassContext parent,
                             ExtensionRegistry registry,
                             org.spockframework.runtime.model.FeatureInfo feature,
                             java.lang.Object testInstance)
    • Method Detail

      • getUniqueId

        public java.lang.String getUniqueId()
      • getDisplayName

        public java.lang.String getDisplayName()
      • getTestMethod

        public java.util.Optional<java.lang.reflect.Method> getTestMethod()
      • getTestInstance

        public java.util.Optional<java.lang.Object> getTestInstance()
      • getTestInstances

        public java.util.Optional<org.junit.jupiter.api.extension.TestInstances> getTestInstances()