Pass identity function as a client wrapper #Relates to elastic/elasticsearchelastic/elasticsearch#16101

Original commit: elastic/x-pack-elasticsearch@5eff4b440b
This commit is contained in:
Simon Willnauer 2016-01-20 09:39:37 +01:00
parent a30c6c2780
commit 01bc1f4124
2 changed files with 4 additions and 2 deletions

View File

@ -53,6 +53,7 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.function.Function;
import static org.elasticsearch.shield.audit.index.IndexNameResolver.Rollover.DAILY; import static org.elasticsearch.shield.audit.index.IndexNameResolver.Rollover.DAILY;
import static org.elasticsearch.shield.audit.index.IndexNameResolver.Rollover.HOURLY; import static org.elasticsearch.shield.audit.index.IndexNameResolver.Rollover.HOURLY;
@ -172,7 +173,7 @@ public class IndexAuditTrailTests extends ShieldIntegTestCase {
return builder.build(); return builder.build();
} }
}; };
cluster2 = new InternalTestCluster("network", randomLong(), createTempDir(), numNodes, numNodes, cluster2Name, cluster2SettingsSource, 0, false, SECOND_CLUSTER_NODE_PREFIX, getMockPlugins()); cluster2 = new InternalTestCluster("network", randomLong(), createTempDir(), numNodes, numNodes, cluster2Name, cluster2SettingsSource, 0, false, SECOND_CLUSTER_NODE_PREFIX, getMockPlugins(), Function.identity());
cluster2.beforeTest(getRandom(), 0.5); cluster2.beforeTest(getRandom(), 0.5);
remoteClient = cluster2.client(); remoteClient = cluster2.client();

View File

@ -24,6 +24,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import static org.elasticsearch.test.InternalTestCluster.clusterName; import static org.elasticsearch.test.InternalTestCluster.clusterName;
import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.is;
@ -106,7 +107,7 @@ public class RemoteIndexAuditTrailStartingTests extends ShieldIntegTestCase {
return builder.build(); return builder.build();
} }
}; };
remoteCluster = new InternalTestCluster("network", randomLong(), createTempDir(), numNodes, numNodes, cluster2Name, cluster2SettingsSource, 0, false, SECOND_CLUSTER_NODE_PREFIX, getMockPlugins()); remoteCluster = new InternalTestCluster("network", randomLong(), createTempDir(), numNodes, numNodes, cluster2Name, cluster2SettingsSource, 0, false, SECOND_CLUSTER_NODE_PREFIX, getMockPlugins(), Function.identity());
remoteCluster.beforeTest(getRandom(), 0.5); remoteCluster.beforeTest(getRandom(), 0.5);
} }