private static ClientResponse mockClientResponse(TimelineClientImpl client,
ClientResponse.Status status, boolean hasError, boolean hasRuntimeError) {
ClientResponse response = mock(ClientResponse.class);
if (hasRuntimeError) {
doThrow(new ClientHandlerException(new ConnectException())).when(client)
.doPostingEntities(any(TimelineEntities.class));
return response;
}
doReturn(response).when(client)
.doPostingEntities(any(TimelineEntities.class));