Drop mocksocket & securemock dependencies from sniffer and rest client (no needed) (#1174)
* Drop mocksocket & securemock dependencies from sniffer and rest client (not needed) Signed-off-by: Andriy Redko <andriy.redko@aiven.io> * Removing .gitignore Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
This commit is contained in:
parent
a43e6cf424
commit
f60d093c63
|
@ -38,6 +38,8 @@ commonscodec = 1.13
|
|||
hamcrest = 2.1
|
||||
securemock = 1.2
|
||||
mocksocket = 1.2
|
||||
mockito = 1.9.5
|
||||
objenesis = 1.0
|
||||
|
||||
# benchmark dependencies
|
||||
jmh = 1.19
|
||||
|
|
|
@ -51,8 +51,8 @@ dependencies {
|
|||
testImplementation "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}"
|
||||
testImplementation "junit:junit:${versions.junit}"
|
||||
testImplementation "org.hamcrest:hamcrest:${versions.hamcrest}"
|
||||
testImplementation "org.elasticsearch:securemock:${versions.securemock}"
|
||||
testImplementation "org.elasticsearch:mocksocket:${versions.mocksocket}"
|
||||
testImplementation "org.mockito:mockito-core:${versions.mockito}"
|
||||
testImplementation "org.objenesis:objenesis:${versions.objenesis}"
|
||||
}
|
||||
|
||||
tasks.withType(CheckForbiddenApis).configureEach {
|
||||
|
|
|
@ -37,7 +37,6 @@ import com.sun.net.httpserver.HttpHandler;
|
|||
import com.sun.net.httpserver.HttpsConfigurator;
|
||||
import com.sun.net.httpserver.HttpsServer;
|
||||
import org.apache.http.HttpHost;
|
||||
import org.elasticsearch.mocksocket.MockHttpServer;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.BeforeClass;
|
||||
|
||||
|
@ -73,7 +72,7 @@ public class RestClientBuilderIntegTests extends RestClientTestCase {
|
|||
|
||||
@BeforeClass
|
||||
public static void startHttpServer() throws Exception {
|
||||
httpsServer = MockHttpServer.createHttps(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0);
|
||||
httpsServer = HttpsServer.create(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0);
|
||||
httpsServer.setHttpsConfigurator(new HttpsConfigurator(getSslContext()));
|
||||
httpsServer.createContext("/", new ResponseHandler());
|
||||
httpsServer.start();
|
||||
|
|
|
@ -39,7 +39,6 @@ import org.apache.http.HttpEntity;
|
|||
import org.apache.http.HttpHost;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.elasticsearch.mocksocket.MockHttpServer;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Assert;
|
||||
import org.junit.BeforeClass;
|
||||
|
@ -61,7 +60,7 @@ public class RestClientGzipCompressionTests extends RestClientTestCase {
|
|||
|
||||
@BeforeClass
|
||||
public static void startHttpServer() throws Exception {
|
||||
httpServer = MockHttpServer.createHttp(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0);
|
||||
httpServer = HttpServer.create(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0);
|
||||
httpServer.createContext("/", new GzipResponseHandler());
|
||||
httpServer.start();
|
||||
}
|
||||
|
|
|
@ -36,7 +36,6 @@ import com.sun.net.httpserver.HttpExchange;
|
|||
import com.sun.net.httpserver.HttpHandler;
|
||||
import com.sun.net.httpserver.HttpServer;
|
||||
import org.apache.http.HttpHost;
|
||||
import org.elasticsearch.mocksocket.MockHttpServer;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
|
@ -107,7 +106,7 @@ public class RestClientMultipleHostsIntegTests extends RestClientTestCase {
|
|||
}
|
||||
|
||||
private static HttpServer createHttpServer() throws Exception {
|
||||
HttpServer httpServer = MockHttpServer.createHttp(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0);
|
||||
HttpServer httpServer = HttpServer.create(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0);
|
||||
httpServer.start();
|
||||
//returns a different status code depending on the path
|
||||
for (int statusCode : getAllStatusCodes()) {
|
||||
|
|
|
@ -52,7 +52,6 @@ import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
|
|||
import org.apache.http.message.BasicHeader;
|
||||
import org.apache.http.nio.entity.NStringEntity;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.elasticsearch.mocksocket.MockHttpServer;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
|
||||
|
@ -107,7 +106,7 @@ public class RestClientSingleHostIntegTests extends RestClientTestCase {
|
|||
}
|
||||
|
||||
private HttpServer createHttpServer() throws Exception {
|
||||
HttpServer httpServer = MockHttpServer.createHttp(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0);
|
||||
HttpServer httpServer = HttpServer.create(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0);
|
||||
httpServer.start();
|
||||
//returns a different status code depending on the path
|
||||
for (int statusCode : getAllStatusCodes()) {
|
||||
|
|
|
@ -47,8 +47,8 @@ dependencies {
|
|||
testImplementation project(":client:test")
|
||||
testImplementation "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}"
|
||||
testImplementation "junit:junit:${versions.junit}"
|
||||
testImplementation "org.elasticsearch:securemock:${versions.securemock}"
|
||||
testImplementation "org.elasticsearch:mocksocket:${versions.mocksocket}"
|
||||
testImplementation "org.mockito:mockito-core:${versions.mockito}"
|
||||
testImplementation "org.objenesis:objenesis:${versions.objenesis}"
|
||||
}
|
||||
|
||||
tasks.named('forbiddenApisMain').configure {
|
||||
|
|
|
@ -48,7 +48,6 @@ import org.opensearch.client.Response;
|
|||
import org.opensearch.client.ResponseException;
|
||||
import org.opensearch.client.RestClient;
|
||||
import org.opensearch.client.RestClientTestCase;
|
||||
import org.elasticsearch.mocksocket.MockHttpServer;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
|
||||
|
@ -153,7 +152,7 @@ public class OpenSearchNodesSnifferTests extends RestClientTestCase {
|
|||
}
|
||||
|
||||
private static HttpServer createHttpServer(final SniffResponse sniffResponse, final int sniffTimeoutMillis) throws IOException {
|
||||
HttpServer httpServer = MockHttpServer.createHttp(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0);
|
||||
HttpServer httpServer = HttpServer.create(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0), 0);
|
||||
httpServer.createContext("/_nodes/http", new ResponseHandler(sniffTimeoutMillis, sniffResponse));
|
||||
return httpServer;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue