logFilter.onResponse(httpRequest, httpResponseThree);
// then
assertThat(logFilter.verify(null), is(""));
assertThat(logFilter.verify(
new Verification()
.withRequest(new HttpRequest())
.withTimes(atLeast(0))
),
is(""));
assertThat(logFilter.verify(
new Verification()
.withRequest(new HttpRequest())
.withTimes(atLeast(3))
),
is("expected:<{ }> but was:<[ {" + System.getProperty("line.separator") +
" \"path\" : \"some_path\"" + System.getProperty("line.separator") +
"}, {" + System.getProperty("line.separator") +
" \"path\" : \"some_other_path\"" + System.getProperty("line.separator") +
"} ]>"));
assertThat(logFilter.verify(
new Verification()
.withRequest(
new HttpRequest()
.withPath("some_path")
)
.withTimes(atLeast(1))
),
is(""));
assertThat(logFilter.verify(
new Verification()
.withRequest(
new HttpRequest()
.withPath("some_path")
)
.withTimes(atLeast(2))
),
is("expected:<{" + System.getProperty("line.separator") +
" \"path\" : \"some_path\"" + System.getProperty("line.separator") +
"}> but was:<[ {" + System.getProperty("line.separator") +
" \"path\" : \"some_path\"" + System.getProperty("line.separator") +
"}, {" + System.getProperty("line.separator") +
" \"path\" : \"some_other_path\"" + System.getProperty("line.separator") +
"} ]>"));
assertThat(logFilter.verify(
new Verification()
.withRequest(
new HttpRequest()
.withPath("some_other_path")
)
.withTimes(atLeast(1))