Skip to content

Implement StrictClient that expects a sequence of requests #41

Closed
@localheinz

Description

@localheinz
Q A
Bug? no
New Feature? yes
Version n/a

Actual Behavior

Currently, when using the Client and configuring matchers using on()

This is fine, but what if we expect a specific sequence of requests to be sent with matching responses? If we use use the Client as it is right now, it's of course possible to define such a sequence.

However, the order in which request are sent does not matter.

What do you think about introducing a StrictClient, that allows specifying an exact sequence of matchers, and that

  • allows introspecting in the assert phase whether all expected requests have been sent (the (the sequence has been completed)
  • throws a specific exception in the act phase when - given a configured sequence of requests - an unexpected request has been sent

I think this could also nicely cover #36.

What do you think?

Possible Solutions

I would of course propose a PR if you think such a feature would be a nice addition.

🤓

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions