Class MicronautSpockExtension<T extends java.lang.annotation.Annotation>

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

    public class MicronautSpockExtension<T extends java.lang.annotation.Annotation>
    extends io.micronaut.test.extensions.AbstractMicronautExtension<org.spockframework.runtime.extension.IMethodInvocation>
    implements org.spockframework.runtime.extension.IAnnotationDrivenExtension<T>
    Extension for Spock.
    Since:
    1.0
    • Field Summary

      • Fields inherited from class io.micronaut.test.extensions.AbstractMicronautExtension

        applicationContext, DISABLED_MESSAGE, embeddedApplication, MISCONFIGURED_MESSAGE, oldValues, refreshScope, specDefinition, TEST_PROPERTY_SOURCE, TEST_ROLLBACK, TEST_TRANSACTION_MODE, TEST_TRANSACTIONAL, testProperties
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void alignMocks​(org.spockframework.runtime.extension.IMethodInvocation context, java.lang.Object instance)  
      protected void resolveTestProperties​(org.spockframework.runtime.extension.IMethodInvocation context, io.micronaut.test.annotation.MicronautTestValue testAnnotationValue, java.util.Map<java.lang.String,​java.lang.Object> testProperties)  
      protected void startApplicationContext()  
      void visitFeatureAnnotation​(T annotation, org.spockframework.runtime.model.FeatureInfo feature)  
      void visitFieldAnnotation​(T annotation, org.spockframework.runtime.model.FieldInfo field)  
      void visitFixtureAnnotation​(T annotation, org.spockframework.runtime.model.MethodInfo fixtureMethod)  
      void visitSpec​(org.spockframework.runtime.model.SpecInfo spec)  
      void visitSpecAnnotation​(T annotation, org.spockframework.runtime.model.SpecInfo spec)  
      • Methods inherited from class io.micronaut.test.extensions.AbstractMicronautExtension

        afterClass, afterCleanupTest, afterEach, afterSetupTest, afterTestClass, afterTestExecution, afterTestMethod, beforeClass, beforeCleanupTest, beforeEach, beforeSetupTest, beforeTestClass, beforeTestExecution, beforeTestMethod, interceptAfterEach, interceptBeforeEach, interceptTest, isTestSuiteBeanPresent, postProcessBuilder
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.spockframework.runtime.extension.IAnnotationDrivenExtension

        visitFeatureAnnotations, visitFieldAnnotations, visitFixtureAnnotations, visitSpecAnnotations
    • Constructor Detail

      • MicronautSpockExtension

        public MicronautSpockExtension()
    • Method Detail

      • visitSpecAnnotation

        public void visitSpecAnnotation​(T annotation,
                                        org.spockframework.runtime.model.SpecInfo spec)
        Specified by:
        visitSpecAnnotation in interface org.spockframework.runtime.extension.IAnnotationDrivenExtension<T extends java.lang.annotation.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 java.lang.annotation.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 java.lang.annotation.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 java.lang.annotation.Annotation>
      • visitSpec

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

        protected void resolveTestProperties​(org.spockframework.runtime.extension.IMethodInvocation context,
                                             io.micronaut.test.annotation.MicronautTestValue testAnnotationValue,
                                             java.util.Map<java.lang.String,​java.lang.Object> testProperties)
        Specified by:
        resolveTestProperties in class io.micronaut.test.extensions.AbstractMicronautExtension<org.spockframework.runtime.extension.IMethodInvocation>
      • startApplicationContext

        protected void startApplicationContext()
        Overrides:
        startApplicationContext in class io.micronaut.test.extensions.AbstractMicronautExtension<org.spockframework.runtime.extension.IMethodInvocation>
      • alignMocks

        protected void alignMocks​(org.spockframework.runtime.extension.IMethodInvocation context,
                                  java.lang.Object instance)
        Specified by:
        alignMocks in class io.micronaut.test.extensions.AbstractMicronautExtension<org.spockframework.runtime.extension.IMethodInvocation>