From 26a07766f0a49c13aecfb3399bca2ee5a581a0d7 Mon Sep 17 00:00:00 2001 From: Areek Zillur Date: Thu, 19 May 2016 18:20:01 -0400 Subject: [PATCH] fix license notification test bug Original commit: elastic/x-pack-elasticsearch@ec1257d3e14d64c71c74ed0d8f3ae88c03b049e9 --- .../plugin/core/LicensesExpiryNotificationTests.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/core/LicensesExpiryNotificationTests.java b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/core/LicensesExpiryNotificationTests.java index 9e019976129..dceab4627aa 100644 --- a/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/core/LicensesExpiryNotificationTests.java +++ b/elasticsearch/x-pack/license-plugin/src/test/java/org/elasticsearch/license/plugin/core/LicensesExpiryNotificationTests.java @@ -11,9 +11,7 @@ import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.license.plugin.TestUtils.AssertingLicensee; import org.elasticsearch.test.ESSingleNodeTestCase; -import java.util.Arrays; import java.util.List; -import java.util.stream.Collectors; import static org.elasticsearch.license.plugin.TestUtils.awaitNoBlock; import static org.elasticsearch.license.plugin.TestUtils.awaitNoPendingTasks; @@ -194,7 +192,7 @@ public class LicensesExpiryNotificationTests extends ESSingleNodeTestCase { msg.append(dumpLicensingStates(states)); assertThat(msg.toString(), licensee.statuses.size(), equalTo(states.length)); for (int i = 0; i < states.length; i++) { - assertThat(msg.toString(), licensee.statuses.get(i), equalTo(states[i])); + assertThat(msg.toString(), licensee.statuses.get(i).getLicenseState(), equalTo(states[i])); } } @@ -202,10 +200,12 @@ public class LicensesExpiryNotificationTests extends ESSingleNodeTestCase { return dumpLicensingStates(statuses.toArray(new Licensee.Status[statuses.size()])); } - private String dumpLicensingStates(Licensee.Status... statuses) { - return dumpLicensingStates((LicenseState[]) Arrays.asList(statuses).stream() - .map(Licensee.Status::getLicenseState).collect(Collectors.toList()).toArray()); + LicenseState[] states = new LicenseState[statuses.length]; + for (int i = 0; i < statuses.length; i++) { + states[i] = statuses[i].getLicenseState(); + } + return dumpLicensingStates(states); } private String dumpLicensingStates(LicenseState... states) {