public class PactProviderRule
extends BaseProviderRule
A junit rule that wraps every test annotated with . Before each test, a mock server will be setup at given port/host that will provide mocked responses for the given provider. After each test, it will be teared down. If no host is given, it will default to 127.0.0.1. If no port is given, it will default to a random port. If you need to use HTTPS, use PactHttpsProviderRuleannotationclass PactVerification
annotationclass PactVerificationpublic PactProviderRule(java.lang.String provider,
java.lang.String hostInterface,
java.lang.Integer port,
au.com.dius.pact.core.model.PactSpecVersion pactVersion,
java.lang.Object target)
Creates a mock provider by the given name
provider - Provider name to mockhostInterface - Host interface to bind to. Defaults to 127.0.0.1port - Port to bind to. Defaults to zero, which will bind to a random port.pactVersion - Pact specification versiontarget - Target test to apply this rule to.public PactProviderRule(java.lang.String provider,
java.lang.String hostInterface,
java.lang.Integer port,
java.lang.Object target)
Creates a mock provider by the given name
provider - Provider name to mockhostInterface - Host interface to bind to. Defaults to 127.0.0.1port - Port to bind to. Defaults to a random port.target - Target test to apply this rule to.public PactProviderRule(java.lang.String provider,
java.lang.Object target)
Creates a mock provider by the given name. Binds to localhost and a random port.
provider - Provider name to mocktarget - Target test to apply this rule to.public PactProviderRule(java.lang.String provider,
au.com.dius.pact.core.model.PactSpecVersion pactSpecVersion,
java.lang.Object target)
Creates a mock provider by the given name. Binds to localhost and a random port.
provider - Provider name to mocktarget - Target test to apply this rule to.