reset();
}
}
public synchronized void dumpToLog(HttpRequest httpRequest, boolean asJava) {
ExpectationSerializer expectationSerializer = new ExpectationSerializer();
if (httpRequest != null) {
HttpRequestMatcher httpRequestMatcher = matcherBuilder.transformsToMatcher(httpRequest);
for (Map.Entry<HttpRequest, HttpResponse> entry : requestResponseLog.entrySet()) {
if (httpRequestMatcher.matches(entry.getKey())) {
if (asJava) {
requestLogger.warn(expectationSerializer.serializeAsJava(new Expectation(entry.getKey(), Times.once()).thenRespond(entry.getValue())));
} else {
requestLogger.warn(expectationSerializer.serialize(new Expectation(entry.getKey(), Times.once()).thenRespond(entry.getValue())));
}
}
}
} else {
for (Map.Entry<HttpRequest, HttpResponse> entry : requestResponseLog.entrySet()) {
if (asJava) {
requestLogger.warn(expectationSerializer.serializeAsJava(new Expectation(entry.getKey(), Times.once()).thenRespond(entry.getValue())));
} else {
requestLogger.warn(expectationSerializer.serialize(new Expectation(entry.getKey(), Times.once()).thenRespond(entry.getValue())));
}
}
}
}