Package au.com.dius.pact.consumer.dsl
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.
-
-
Constructor Summary
Constructors Constructor Description PluginRuleMatcher(String ruleName, Object value, Map<String, JsonValue> values, Boolean generate)PluginRuleMatcher(String ruleName, Object value, Map<String, JsonValue> values)PluginRuleMatcher(String ruleName, Object value)
-
Method Summary
Modifier and Type Method Description final StringgetRuleName()Name of the rule, which is also the key it is resolved by in the plugin catalogue ObjectgetValue()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 BooleangetGenerate()If the plugin's generator of the same name should replace the example value on each run -
-
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
-
-
-
-