Class MicronautSpockExtension<T extends Annotation>

java.lang.Object
io.micronaut.test.extensions.AbstractMicronautExtension<org.spockframework.runtime.extension.IMethodInvocation>
io.micronaut.test.extensions.spock.MicronautSpockExtension<T>
Type Parameters:
T - The MicronautTest annotation
All Implemented Interfaces:
TestExecutionListener, TestMethodInterceptor<Object>, org.spockframework.runtime.extension.IAnnotationDrivenExtension<T>

public class MicronautSpockExtension<T extends Annotation> extends AbstractMicronautExtension<org.spockframework.runtime.extension.IMethodInvocation> implements org.spockframework.runtime.extension.IAnnotationDrivenExtension<T>
Extension for Spock.
Since:
1.0
Author:
graemerocher
  • Constructor Details

    • MicronautSpockExtension

      public MicronautSpockExtension()
  • Method Details

    • visitSpecAnnotation

      public void visitSpecAnnotation(T annotation, org.spockframework.runtime.model.SpecInfo spec)
      Specified by:
      visitSpecAnnotation in interface org.spockframework.runtime.extension.IAnnotationDrivenExtension<T extends Annotation>
    • visitFeatureAnnotation

      public void visitFeatureAnnotation(T annotation, org.spockframework.runtime.model.FeatureInfo feature)
      Specified by:
      visitFeatureAnnotation in interface org.spockframework.runtime.extension.IAnnotationDrivenExtension<T extends Annotation>
    • visitFixtureAnnotation

      public void visitFixtureAnnotation(T annotation, org.spockframework.runtime.model.MethodInfo fixtureMethod)
      Specified by:
      visitFixtureAnnotation in interface org.spockframework.runtime.extension.IAnnotationDrivenExtension<T extends Annotation>
    • visitFieldAnnotation

      public void visitFieldAnnotation(T annotation, org.spockframework.runtime.model.FieldInfo field)
      Specified by:
      visitFieldAnnotation in interface org.spockframework.runtime.extension.IAnnotationDrivenExtension<T extends Annotation>
    • visitSpec

      public void visitSpec(org.spockframework.runtime.model.SpecInfo spec)
      Specified by:
      visitSpec in interface org.spockframework.runtime.extension.IAnnotationDrivenExtension<T extends Annotation>
    • resolveTestProperties

      protected void resolveTestProperties(org.spockframework.runtime.extension.IMethodInvocation context, MicronautTestValue testAnnotationValue, Map<String,Object> testProperties)
      Description copied from class: AbstractMicronautExtension
      Resolves any test properties.
      Specified by:
      resolveTestProperties in class AbstractMicronautExtension<org.spockframework.runtime.extension.IMethodInvocation>
      Parameters:
      context - The test context
      testAnnotationValue - The test annotation
      testProperties - The test properties
    • startApplicationContext

      protected void startApplicationContext()
      Description copied from class: AbstractMicronautExtension
      Starts the application context.
      Overrides:
      startApplicationContext in class AbstractMicronautExtension<org.spockframework.runtime.extension.IMethodInvocation>
    • alignMocks

      protected void alignMocks(org.spockframework.runtime.extension.IMethodInvocation context, Object instance)
      Specified by:
      alignMocks in class AbstractMicronautExtension<org.spockframework.runtime.extension.IMethodInvocation>
      Parameters:
      context - The context
      instance - The mock instance to inject