@Test
public void shouldRetrieveExpectationsMockServer() throws IOException {
// given
MockHttpServletResponse httpServletResponse = new MockHttpServletResponse();
MockHttpServletRequest httpServletRequest = new MockHttpServletRequest("PUT", "/retrieve");
Expectation expectation = new Expectation(new HttpRequest(), Times.unlimited()).thenRespond(new HttpResponse());
httpServletRequest.setContent("requestBytes".getBytes());
when(mockHttpRequestSerializer.deserialize(anyString())).thenReturn(expectation.getHttpRequest());
when(mockLogFilter.retrieve(any(HttpRequest.class))).thenReturn(new Expectation[]{expectation});
when(mockExpectationSerializer.serialize(any(Expectation[].class))).thenReturn("expectations_response");
// when
mockServerServlet.doPut(httpServletRequest, httpServletResponse);
// then
verify(mockLogFilter).retrieve(expectation.getHttpRequest());
assertThat(httpServletResponse.getContentAsByteArray(), is("expectations_response".getBytes()));
assertThat(httpServletResponse.getStatus(), is(HttpStatusCode.OK_200.code()));
verifyNoMoreInteractions(mockHttpServletToMockServerRequestMapper);
}