Clone wiki

fakehttpserver / Response_Actions

Response Actions

What is it

A ResponseAction is an object which performs an action (probably on the response) in case an expectation was met. Examples are setting response code, content, content-type, etc.

How do I use it

When you add an expectation, you do the following:

new Expectations() {{
  oneOf(server).post();
    will(...);
}};

where ... is where you add your ResponseActions.

se.dannej.fakehttpserver.expect.ResponseActions has a few standard ResponseActions.

How do I write my own

All you have to do is implement se.dannej.fakehttpserver.expect.ResponseAction.

Updated