logFilter.onResponse(httpRequest, httpResponseThree);
// then
assertArrayEquals(logFilter.retrieve(null),
new Expectation[]{
new Expectation(httpRequest, Times.once()).thenRespond(httpResponseOne),
new Expectation(httpRequest, Times.once()).thenRespond(httpResponseThree),
new Expectation(otherHttpRequest, Times.once()).thenRespond(httpResponseTwo)
});
assertArrayEquals(logFilter.retrieve(new HttpRequest()),
new Expectation[]{
new Expectation(httpRequest, Times.once()).thenRespond(httpResponseOne),
new Expectation(httpRequest, Times.once()).thenRespond(httpResponseThree),
new Expectation(otherHttpRequest, Times.once()).thenRespond(httpResponseTwo)
});
assertArrayEquals(logFilter.retrieve(new HttpRequest().withPath("some_path")),
new Expectation[]{
new Expectation(httpRequest, Times.once()).thenRespond(httpResponseOne),
new Expectation(httpRequest, Times.once()).thenRespond(httpResponseThree)
});
assertArrayEquals(logFilter.retrieve(new HttpRequest().withPath("some_other_path")),
new Expectation[]{
new Expectation(otherHttpRequest, Times.once()).thenRespond(httpResponseTwo)
});
}