Class PluginRuleMatcher

  • All Implemented Interfaces:

    
    public final class PluginRuleMatcher
    extends Matcher
                        

    Matches a value with a matching rule provided by a plugin, optionally generating it with a plugin-provided generator of the same name.

    The rule name is resolved against the plugin catalogue when the rule is applied, so the plugin providing it has to be loaded (usingPlugin) for the test to work - and for the Pact file to record that it is needed. See proposal 006, Field-level matchers and generators.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final String getRuleName() Name of the rule, which is also the key it is resolved by in the plugin catalogue
      Object getValue() The example value to use, which is what the provider's real value is compared against
      final Map<String, JsonValue> getValues() Configuration values for the rule.
      final Boolean getGenerate() If the plugin's generator of the same name should replace the example value on each run
      • Methods inherited from class au.com.dius.pact.consumer.dsl.Matcher

        getGenerator, getMatcher
      • Methods inherited from class java.lang.Object

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

      • getRuleName

         final String getRuleName()

        Name of the rule, which is also the key it is resolved by in the plugin catalogue

      • getValue

         Object getValue()

        The example value to use, which is what the provider's real value is compared against

      • getValues

         final Map<String, JsonValue> getValues()

        Configuration values for the rule. The keys a rule accepts are the plugin's own.

      • getGenerate

         final Boolean getGenerate()

        If the plugin's generator of the same name should replace the example value on each run