ProxyServer { public int getPort() { return port; } ProxyServer();  ProxyServer(final int port); void start(final int requestTimeOut); void cleanup(); void stop(); int getPort(); void setPort(final int port); Har getHar(); Har newHar(final String initialPageRef); void newPage(String pageRef); void endPage(); void setRetryCount(final int count); void remapHost(final String source, final String target); void addRequestInterceptor(final RequestInterceptor interceptor); void addResponseInterceptor(final ResponseInterceptor interceptor); StreamManager getStreamManager(); void setRequestTimeout(final int requestTimeout); void setSocketOperationTimeout(final int readTimeout); void setConnectionTimeout(final int connectionTimeout); void autoBasicAuthorization(final String domain, final String username, final String password); void rewriteUrl(final String match, final String replace); void blacklistRequests(final String pattern, final int responseCode); void whitelistRequests(final String[] patterns, final int responseCode); void addHeader(final String name, final String value); void setCaptureHeaders(final boolean captureHeaders); void setCaptureContent(final boolean captureContent); void setCaptureBinaryContent(final boolean captureBinaryContent); void clearDNSCache(); void setDNSCacheTimeout(final int timeout); void waitForNetworkTrafficToStop(final long quietPeriodInMs, final long timeoutInMs); void setOptions(final Map<String, String> options); static Boolean getResponseVolatile(); static void setResponseVolatile(Boolean responseVolatile); static Boolean getShouldKeepSslConnectionAlive(); static void setShouldKeepSslConnectionAlive(Boolean shouldKeepSslConnectionAlive); static int PROXY_TIMEOUT; }
@Test public void portAllocation() throws Exception { assertThat(server.getPort(), not(equalTo(0))); }