Class GradlePluginTestingStrategy.Spec<T extends GradlePluginTestingStrategy>

  • Type Parameters:
    T - testing strategy type
    Enclosing interface:
    GradlePluginTestingStrategy

    public abstract static class GradlePluginTestingStrategy.Spec<T extends GradlePluginTestingStrategy>
    extends java.lang.Object
    Represents specification for GradlePluginTestingStrategy. The specification will walk through each element of a composite testing strategy as well as itself when testing the satisfaction.
    • Constructor Detail

      • Spec

        public Spec()
    • Method Detail

      • isSatisfiedBy

        public abstract boolean isSatisfiedBy​(@Nullable
                                              T t)
      • matches

        public static <T extends GradlePluginTestingStrategyGradlePluginTestingStrategy.Spec<T> matches​(java.util.function.Predicate<? super T> predicate)
        Returns a specification that matches any testing strategy against the specified predicate. In the case of a composite testing strategy, the specification will first test the whole composite against the predicate followed by a successive test of each composed testing strategy. def strategy = test.strategies.composite(jdk9, gradle7) assert matches({ it == jdk9 }).isSatisfiedBy(strategy) assert matches({ it == jdk9 }).and(matches({it == gradle7 })).isSatisfiedBy(strategy) assert !matches({ it == jdk11 }).isSatisfiedBy(strategy)
        Type Parameters:
        T - testing strategy type to satisfy
        Parameters:
        predicate - a predicate to match any testing strategy, must not be null
        Returns:
        a specification that matches any testing strategy with the specified predicate, never null