Class IntegrationTestExtension

  • All Implemented Interfaces:
    org.junit.jupiter.api.extension.ExecutionCondition, org.junit.jupiter.api.extension.Extension

    public class IntegrationTestExtension
    extends java.lang.Object
    implements org.junit.jupiter.api.extension.ExecutionCondition
    Use this IntegrationTestExtension if you want to disable your integration tests for the normal test run. Put
         "@ExtendWith(IntegrationTestExtension.class)"
     
    in front of your JUnit-5 test class and your test is enabled. To enable it for integration testing call your test with
         -Dpatterntesting.integrationTest=true
     

    NOTE: If you use e.g. Maven to run your test you can control it via maven-failsafe-plugin and '...IT' as suffix for your test class. But not all IDEs distinguish between normal tests ('...Test') and integration tests ('...IT'). With this extension you can control it by setting the system property "patterntesting.integrationTest".

    Since:
    2.0 (06.11.2019)
    Author:
    oboehm
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.junit.jupiter.api.extension.ConditionEvaluationResult evaluateExecutionCondition​(org.junit.jupiter.api.extension.ExtensionContext context)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IntegrationTestExtension

        public IntegrationTestExtension()
    • Method Detail

      • evaluateExecutionCondition

        public org.junit.jupiter.api.extension.ConditionEvaluationResult evaluateExecutionCondition​(org.junit.jupiter.api.extension.ExtensionContext context)
        Specified by:
        evaluateExecutionCondition in interface org.junit.jupiter.api.extension.ExecutionCondition