PactBuilder class

DSL for building pact contracts.

Builds an interaction for each state-request-response tuple.

This DSL doesn't match with the formal specification by design. For instance, the state is mandatory and only after that we can define the requests. These changes makes reasoning about pacts easier.

Not all features are available at first, but can be added as needed: . Request matchers . Generators . Encoders

Constructors

PactBuilder(String consumer, String provider)

Properties

consumer String
final
hashCode int
The hash code for this object.
no setterinherited
provider String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stateBuilders List<StateBuilder>
no setter

Methods

addState(void func(StateBuilder stateBuilder)) RequestTester
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validate({bool requireTests = true}) → void

Operators

operator ==(Object other) bool
The equality operator.
inherited