aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-http-client
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@verizonmedia.com>2020-01-07 13:15:14 +0100
committerJon Bratseth <bratseth@verizonmedia.com>2020-01-07 13:15:14 +0100
commitb0d801daed411fa114223a5e6f0663b595334de5 (patch)
tree5235c9d2cb6482ec48ef941f849b9e2d2310d4a3 /vespa-http-client
parentcf98aea5e47f823fe3efc87073010e39d1048956 (diff)
Use 'localhost' as hostname
Diffstat (limited to 'vespa-http-client')
-rw-r--r--vespa-http-client/src/test/java/com/yahoo/vespa/http/client/FeedClientTest.java2
-rw-r--r--vespa-http-client/src/test/java/com/yahoo/vespa/http/client/SyncFeedClientTest.java2
-rw-r--r--vespa-http-client/src/test/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnectionTest.java19
3 files changed, 12 insertions, 11 deletions
diff --git a/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/FeedClientTest.java b/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/FeedClientTest.java
index 88deaa07e12..aa47128f436 100644
--- a/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/FeedClientTest.java
+++ b/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/FeedClientTest.java
@@ -27,7 +27,7 @@ public class FeedClientTest {
SessionParams sessionParams = new SessionParams.Builder()
.addCluster(new Cluster.Builder()
- .addEndpoint(Endpoint.create("hostname"))
+ .addEndpoint(Endpoint.create("localhost"))
.build())
.setConnectionParams(new ConnectionParams.Builder()
.setDryRun(true)
diff --git a/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/SyncFeedClientTest.java b/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/SyncFeedClientTest.java
index 5a93fdbf9e1..6e2c6cafc9b 100644
--- a/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/SyncFeedClientTest.java
+++ b/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/SyncFeedClientTest.java
@@ -30,7 +30,7 @@ public class SyncFeedClientTest {
public void testFeedJson() {
SessionParams sessionParams = new SessionParams.Builder()
.addCluster(new Cluster.Builder()
- .addEndpoint(Endpoint.create("hostname"))
+ .addEndpoint(Endpoint.create("localhost"))
.build())
.setConnectionParams(new ConnectionParams.Builder()
.setDryRun(true)
diff --git a/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnectionTest.java b/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnectionTest.java
index d49f4093a06..59a8b613e67 100644
--- a/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnectionTest.java
+++ b/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnectionTest.java
@@ -50,14 +50,14 @@ public class ApacheGatewayConnectionTest {
@Test
public void testProtocolV3() throws Exception {
- final Endpoint endpoint = Endpoint.create("hostname", 666, false);
+ final Endpoint endpoint = Endpoint.create("localhost", 666, false);
final FeedParams feedParams = new FeedParams.Builder().setDataFormat(FeedParams.DataFormat.JSON_UTF8).build();
final String clusterSpecificRoute = "";
final ConnectionParams connectionParams = new ConnectionParams.Builder()
.build();
final List<Document> documents = new ArrayList<>();
- final String vespaDocContent ="Hello, I a JSON doc.";
+ final String vespaDocContent = "Hello, I a JSON doc.";
final String docId = "42";
final AtomicInteger requestsReceived = new AtomicInteger(0);
@@ -84,7 +84,7 @@ public class ApacheGatewayConnectionTest {
@Test(expected=IllegalArgumentException.class)
public void testServerReturnsBadSessionInV3() throws Exception {
- final Endpoint endpoint = Endpoint.create("hostname", 666, false);
+ final Endpoint endpoint = Endpoint.create("localhost", 666, false);
final FeedParams feedParams = new FeedParams.Builder().setDataFormat(FeedParams.DataFormat.JSON_UTF8).build();
final String clusterSpecificRoute = "";
final ConnectionParams connectionParams = new ConnectionParams.Builder()
@@ -108,7 +108,7 @@ public class ApacheGatewayConnectionTest {
@Test(expected=RuntimeException.class)
public void testBadConfigParameters() throws Exception {
- final Endpoint endpoint = Endpoint.create("hostname", 666, false);
+ final Endpoint endpoint = Endpoint.create("localhost", 666, false);
final FeedParams feedParams = new FeedParams.Builder().setDataFormat(FeedParams.DataFormat.JSON_UTF8).build();
final String clusterSpecificRoute = "";
final ConnectionParams connectionParams = new ConnectionParams.Builder()
@@ -128,7 +128,7 @@ public class ApacheGatewayConnectionTest {
@Test
public void testJsonDocumentHeader() throws Exception {
- final Endpoint endpoint = Endpoint.create("hostname", 666, false);
+ final Endpoint endpoint = Endpoint.create("localhost", 666, false);
final FeedParams feedParams = new FeedParams.Builder().setDataFormat(FeedParams.DataFormat.JSON_UTF8).build();
final String clusterSpecificRoute = "";
final ConnectionParams connectionParams = new ConnectionParams.Builder()
@@ -187,7 +187,7 @@ public class ApacheGatewayConnectionTest {
*/
@Test
public void testCompressedWriteOperations() throws Exception {
- final Endpoint endpoint = Endpoint.create("hostname", 666, false);
+ final Endpoint endpoint = Endpoint.create("localhost", 666, false);
final FeedParams feedParams = new FeedParams.Builder().setDataFormat(FeedParams.DataFormat.XML_UTF8).build();
final String clusterSpecificRoute = "";
final ConnectionParams connectionParams = new ConnectionParams.Builder()
@@ -237,7 +237,7 @@ public class ApacheGatewayConnectionTest {
}
@Test
- public void dynamic_headers_are_added_to_the_response() throws IOException, ServerResponseException, InterruptedException {
+ public void dynamic_headers_are_added_to_the_response() throws IOException, ServerResponseException {
ConnectionParams.HeaderProvider headerProvider = mock(ConnectionParams.HeaderProvider.class);
when(headerProvider.getHeaderValue())
.thenReturn("v1")
@@ -260,7 +260,7 @@ public class ApacheGatewayConnectionTest {
ApacheGatewayConnection apacheGatewayConnection =
new ApacheGatewayConnection(
- Endpoint.create("hostname", 666, false),
+ Endpoint.create("localhost", 666, false),
new FeedParams.Builder().build(),
"",
connectionParams,
@@ -288,7 +288,7 @@ public class ApacheGatewayConnectionTest {
ApacheGatewayConnection apacheGatewayConnection =
new ApacheGatewayConnection(
- Endpoint.create("hostname", 666, false),
+ Endpoint.create("localhost", 666, false),
new FeedParams.Builder().build(),
"",
new ConnectionParams.Builder().build(),
@@ -379,4 +379,5 @@ public class ApacheGatewayConnectionTest {
when(response.getEntity()).thenReturn(httpEntity);
return response;
}
+
}