Skip to content

Instantly share code, notes, and snippets.

@mbjelac
Last active November 17, 2017 08:21
Show Gist options
  • Save mbjelac/84a9310a7c96ba6c1d802f5c2dddddc9 to your computer and use it in GitHub Desktop.
Save mbjelac/84a9310a7c96ba6c1d802f5c2dddddc9 to your computer and use it in GitHub Desktop.
troubleshooting MockServerClient.reset 4 second lag
import org.apache.http.client.fluent.Request;
import org.junit.Test;
import org.mockserver.client.server.MockServerClient;
import java.io.IOException;
public class MockServerTroubleshootingTest {
private static final String HOST = "192.168.0.196";
private static final int PORT = 1080;
@Test
public void reset_with_MockServerClient() {
new MockServerClient(HOST, PORT).reset();
}
@Test
public void reset_with_apache() throws IOException {
Request.Put("http://" + HOST + ":" + PORT + "/reset")
.addHeader("Host", HOST + ":" + PORT)
.addHeader("Accept-Encoding", "gzip,deflate")
.addHeader("Connection", "keep-alive")
.execute();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment