public class SelectorBuilder
Builder for setting up consumer version selectors in provider JUnit tests. See https://docs.pact.io/pact_broker/advanced_topics/consumer_version_selectors
public SelectorBuilder()
Builder for setting up consumer version selectors in provider JUnit tests. See https://docs.pact.io/pact_broker/advanced_topics/consumer_version_selectors
@NotNull public java.util.List<au.com.dius.pact.core.pactbroker.ConsumerVersionSelectors> getSelectors()
@NotNull public SelectorBuilder mainBranch()
The latest version from the main branch of each consumer, as specified by the consumer's mainBranch property.
@JvmOverloads @NotNull public SelectorBuilder branch(@NotNull java.lang.String name, @Nullable java.lang.String consumer, @Nullable java.lang.String fallback)
The latest version from a particular branch of each consumer, or for a particular consumer if the second parameter is provided. If fallback is provided, falling back to the fallback branch if none is found from the specified branch.
name - Branch name
consumer - Consumer name (optional)
fallback - Fall back to this branch if none is found from the specified branch (optional)
@JvmOverloads @NotNull public SelectorBuilder branch(@NotNull java.lang.String name, @Nullable java.lang.String consumer)
The latest version from a particular branch of each consumer, or for a particular consumer if the second parameter is provided. If fallback is provided, falling back to the fallback branch if none is found from the specified branch.
name - Branch name
consumer - Consumer name (optional)
@JvmOverloads @NotNull public SelectorBuilder branch(@NotNull java.lang.String name)
The latest version from a particular branch of each consumer, or for a particular consumer if the second parameter is provided. If fallback is provided, falling back to the fallback branch if none is found from the specified branch.
name - Branch name
@NotNull public SelectorBuilder deployedOrReleased()
All the currently deployed and currently released and supported versions of each consumer.
@NotNull public SelectorBuilder matchingBranch()
The latest version from any branch of the consumer that has the same name as the current branch of the provider. Used for coordinated development between consumer and provider teams using matching feature branch names.
@NotNull public SelectorBuilder deployedTo(@NotNull java.lang.String environment)
Any versions currently deployed to the specified environment
@NotNull public SelectorBuilder releasedTo(@NotNull java.lang.String environment)
Any versions currently released and supported in the specified environment
@NotNull public SelectorBuilder environment(@NotNull java.lang.String environment)
any versions currently deployed or released and supported in the specified environment
@NotNull public SelectorBuilder tag(@NotNull java.lang.String name)
All versions with the specified tag
@NotNull public SelectorBuilder latestTag(@NotNull java.lang.String name)
The latest version for each consumer with the specified tag
@Deprecated @NotNull public SelectorBuilder selector(@Nullable java.lang.String tagName, @Nullable java.lang.Boolean latest, @Nullable java.lang.String fallbackTag, @Nullable java.lang.String consumer)
Generic selector.
With just the tag name, returns all versions with the specified tag.
With latest, returns the latest version for each consumer with the specified tag.
With a fallback tag, returns the latest version for each consumer with the specified tag, falling back to the fallbackTag if non is found with the specified tag.
With a consumer name, returns the latest version for a specified consumer with the specified tag.
With only latest, returns the latest version for each consumer. NOT RECOMMENDED as it suffers from race conditions when pacts are published from multiple branches.
@NotNull public SelectorBuilder rawSelectorJson(@NotNull java.lang.String json)
Selector in raw JSON form.
@NotNull public java.util.List<au.com.dius.pact.core.pactbroker.ConsumerVersionSelectors> build()
Construct the final list of consumer version selectors