From 4c349a76fb257cc567b4001073ae01075d96525c Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Fri, 7 Oct 2016 11:58:59 +0200 Subject: [PATCH] just use hostname in tests since it's simplify forwarding Original commit: elastic/x-pack-elasticsearch@b5cf3a443561fc7ff915a1d9b1fdbe29b6faef80 --- .../xpack/security/audit/index/IndexAuditTrailTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailTests.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailTests.java index 93c49327914..49495cc12cd 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailTests.java @@ -265,7 +265,7 @@ public class IndexAuditTrailTests extends SecurityIntegTestCase { logger.info("--> settings: [{}]", settings.getAsMap().toString()); DiscoveryNode localNode = mock(DiscoveryNode.class); when(localNode.getHostAddress()).thenReturn(remoteAddress.getAddress()); - when(localNode.getHostName()).thenReturn(remoteAddress.getHost()); + when(localNode.getHostName()).thenReturn(remoteAddress.getAddress()); ClusterService clusterService = mock(ClusterService.class); when(clusterService.localNode()).thenReturn(localNode); threadPool = new TestThreadPool("index audit trail tests"); @@ -686,7 +686,7 @@ public class IndexAuditTrailTests extends SecurityIntegTestCase { DateTime dateTime = ISODateTimeFormat.dateTimeParser().withZoneUTC().parseDateTime((String) sourceMap.get("@timestamp")); assertThat(dateTime.isBefore(DateTime.now(DateTimeZone.UTC)), is(true)); - assertThat(remoteAddress.getHost(), equalTo(sourceMap.get("node_host_name"))); + assertThat(remoteAddress.getAddress(), equalTo(sourceMap.get("node_host_name"))); assertThat(remoteAddress.getAddress(), equalTo(sourceMap.get("node_host_address"))); assertEquals(layer, sourceMap.get("layer"));