response.setResponseContent("{ firstName: 'Kalle', secondName: 'Ek' }");
return response;
}
private ExtendedHttpMethod prepareHttpMethodWith(String path) throws URISyntaxException, MalformedURLException {
ExtendedHttpMethod httpMethod = mock(ExtendedHttpMethod.class);
when(httpMethod.getResponseContentType()).thenReturn("text/json");
when(httpMethod.getMethod()).thenReturn("GET");
when(httpMethod.getProtocolVersion()).thenReturn(new ProtocolVersion("http", 1, 1));
SoapUIMetrics soapUIMetrics = new SoapUIMetrics(mock(HttpTransportMetrics.class),
mock(HttpTransportMetrics.class));
when(httpMethod.getMetrics()).thenReturn(soapUIMetrics);
when(httpMethod.getAllHeaders()).thenReturn(new Header[0]);
when(httpMethod.getResponseReadTime()).thenReturn(10L);
when(httpMethod.getURI()).thenReturn(new java.net.URI(ENDPOINT + path));
when(httpMethod.getURL()).thenReturn(new java.net.URL(ENDPOINT + path));
return httpMethod;
}