File tree 1 file changed +37
-0
lines changed
consumer/src/main/kotlin/au/com/dius/pact/consumer/dsl
1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,43 @@ class SynchronousMessagePactBuilder @JvmOverloads constructor(
103
103
return this
104
104
}
105
105
106
+ /* *
107
+ * Marks the interaction as pending.
108
+ */
109
+ fun pending (pending : Boolean ): SynchronousMessagePactBuilder {
110
+ if (messages.isEmpty()) {
111
+ throw InvalidPactException (" expectsToReceive is required before pending" )
112
+ }
113
+ val message = messages.last()
114
+ message.pending = pending
115
+ return this
116
+ }
117
+
118
+ /* *
119
+ * Adds a text comment to the interaction
120
+ */
121
+ fun comment (comment : String ): SynchronousMessagePactBuilder {
122
+ if (messages.isEmpty()) {
123
+ throw InvalidPactException (" expectsToReceive is required before comment" )
124
+ }
125
+ val message = messages.last()
126
+ message.addTextComment(comment)
127
+ return this
128
+ }
129
+
130
+ /* *
131
+ * Sets the unique key for the interaction. If this is not set, or is empty, a key will be calculated from the
132
+ * contents of the interaction.
133
+ */
134
+ fun key (key : String? ): SynchronousMessagePactBuilder {
135
+ if (messages.isEmpty()) {
136
+ throw InvalidPactException (" expectsToReceive is required before key" )
137
+ }
138
+ val message = messages.last()
139
+ message.key = key
140
+ return this ;
141
+ }
142
+
106
143
/* *
107
144
* Adds a message expectation to the pact.
108
145
*
You can’t perform that action at this time.
0 commit comments