mockserver-client 7.1.0 → 7.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -182,14 +182,24 @@ module MockServer
182
182
  @client.upsert(@expectation)
183
183
  end
184
184
 
185
- # Set a forward class callback action.
186
- # @param class_callback [HttpClassCallback]
185
+ # Set a response class-callback action: the server invokes a server-side
186
+ # class implementing the response callback interface. Accepts either a
187
+ # fully-qualified class-name String (e.g. "com.example.MyResponseCallback")
188
+ # or a pre-built {HttpClassCallback} (carrying an optional +delay+ /
189
+ # +primary+).
190
+ # @param class_callback [String, HttpClassCallback]
191
+ # @return [Array<Expectation>]
192
+ def respond_with_class_callback(class_callback)
193
+ @expectation.http_response_class_callback = class_callback
194
+ @client.upsert(@expectation)
195
+ end
196
+
197
+ # Set a forward class-callback action: the server invokes a server-side
198
+ # class implementing the forward callback interface. Accepts either a
199
+ # fully-qualified class-name String or a pre-built {HttpClassCallback}.
200
+ # @param class_callback [String, HttpClassCallback]
187
201
  # @return [Array<Expectation>]
188
202
  def forward_with_class_callback(class_callback)
189
- unless class_callback.is_a?(HttpClassCallback)
190
- raise TypeError,
191
- "Expected HttpClassCallback, got #{class_callback.class.name}"
192
- end
193
203
  @expectation.http_forward_class_callback = class_callback
194
204
  @client.upsert(@expectation)
195
205
  end