Skip to content

Chaining Expectations In MockClient #531

@ryber

Description

@ryber

Is your feature request related to a problem? Please describe.
The ability to chain and order expectations in the MockClient

Describe the solution you'd like
this is a simple example. This should work but the first assert fails because the the last expect overrides the first one

      var mock = MockClient.register();
        mock.expect(GET,"http://path/one").thenReturn(FORBIDDEN);
        mock.expect(GET,"http://path/one").thenReturn(OK);

        assertEquals(FORBIDDEN, Unirest.get("http://path/one").asEmpty().getStatus());
        assertEquals(OK, Unirest.get("http://path/one").asEmpty().getStatus());

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature RequestValid feature request to add to the backlog

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions