From f9d22b3598d61ddf123e185cc384c5540cd8a213 Mon Sep 17 00:00:00 2001 From: David Pilato Date: Thu, 30 Jun 2016 11:32:39 +0200 Subject: [PATCH] Add more javadoc and rename test --- .../org/elasticsearch/discovery/gce/GceDiscoveryTests.java | 6 ++++-- .../zones/europe-west1-b/instances | 0 .../zones/us-central1-a/instances | 0 3 files changed, 4 insertions(+), 2 deletions(-) rename plugins/discovery-gce/src/test/resources/org/elasticsearch/discovery/gce/compute/v1/projects/{emptyregion16967 => noregionreturnsemptylist}/zones/europe-west1-b/instances (100%) rename plugins/discovery-gce/src/test/resources/org/elasticsearch/discovery/gce/compute/v1/projects/{emptyregion16967 => noregionreturnsemptylist}/zones/us-central1-a/instances (100%) diff --git a/plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/GceDiscoveryTests.java b/plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/GceDiscoveryTests.java index a256b660d5e..92eb12a99b2 100644 --- a/plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/GceDiscoveryTests.java +++ b/plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/GceDiscoveryTests.java @@ -256,9 +256,11 @@ public class GceDiscoveryTests extends ESTestCase { } /** - * For issue https://github.com/elastic/elasticsearch/issues/16967 + * For issue https://github.com/elastic/elasticsearch/issues/16967: + * When using multiple regions and one of them has no instance at all, this + * was producing a NPE as a result. */ - public void testEmptyRegion16967() { + public void testNoRegionReturnsEmptyList() { Settings nodeSettings = Settings.builder() .put(GceComputeService.PROJECT_SETTING.getKey(), projectName) .putArray(GceComputeService.ZONE_SETTING.getKey(), "europe-west1-b", "us-central1-a") diff --git a/plugins/discovery-gce/src/test/resources/org/elasticsearch/discovery/gce/compute/v1/projects/emptyregion16967/zones/europe-west1-b/instances b/plugins/discovery-gce/src/test/resources/org/elasticsearch/discovery/gce/compute/v1/projects/noregionreturnsemptylist/zones/europe-west1-b/instances similarity index 100% rename from plugins/discovery-gce/src/test/resources/org/elasticsearch/discovery/gce/compute/v1/projects/emptyregion16967/zones/europe-west1-b/instances rename to plugins/discovery-gce/src/test/resources/org/elasticsearch/discovery/gce/compute/v1/projects/noregionreturnsemptylist/zones/europe-west1-b/instances diff --git a/plugins/discovery-gce/src/test/resources/org/elasticsearch/discovery/gce/compute/v1/projects/emptyregion16967/zones/us-central1-a/instances b/plugins/discovery-gce/src/test/resources/org/elasticsearch/discovery/gce/compute/v1/projects/noregionreturnsemptylist/zones/us-central1-a/instances similarity index 100% rename from plugins/discovery-gce/src/test/resources/org/elasticsearch/discovery/gce/compute/v1/projects/emptyregion16967/zones/us-central1-a/instances rename to plugins/discovery-gce/src/test/resources/org/elasticsearch/discovery/gce/compute/v1/projects/noregionreturnsemptylist/zones/us-central1-a/instances