Annotation Type VaryFeatures


  • @Retention(RUNTIME)
    @Target({TYPE,METHOD})
    @ExtendWith(org.togglz.junit5.FeatureVariationTogglzExtension.class)
    public @interface VaryFeatures

    Provides a TestTemplateInvocationContextProvider to run TestTemplates with a variation of enabled and disabled features.

    Example Usage:

         class PermutationTests {
    
             @TestTemplate
             @VaryFeatures(MyVariationSetProvider.class)
             void run() {
                 // run testing code ...
                 // ONE is enabled
                 // TWO is disabled
                 // THREE is disabled in the first run and enabled in the second run
             }
    
             private static class MyVariationSetProvider implements VariationSetProvider {
    
                 @Override
                 public VariationSet buildVariationSet() {
                     return create(MyFeatures.class).enable(MyFeatures.ONE).disable(MyFeatures.TWO).vary(MyFeatures.THREE);
                 }
             }
         }
     
    Author:
    Roland Weisleder