From 85a72ee3b5a6a13db3b41cc78edd591d6dce626b Mon Sep 17 00:00:00 2001 From: Areek Zillur Date: Tue, 7 Oct 2014 13:15:38 -0400 Subject: [PATCH] update Transport tests Original commit: elastic/x-pack-elasticsearch@1623939755acf220e3bd2435d4a26f36060badd5 --- .../license/plugin/LicenseTransportTests.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/test/java/org/elasticsearch/license/plugin/LicenseTransportTests.java b/src/test/java/org/elasticsearch/license/plugin/LicenseTransportTests.java index b2154f5e900..d5c624bd503 100644 --- a/src/test/java/org/elasticsearch/license/plugin/LicenseTransportTests.java +++ b/src/test/java/org/elasticsearch/license/plugin/LicenseTransportTests.java @@ -48,6 +48,7 @@ import java.util.concurrent.ExecutionException; import static org.elasticsearch.test.ElasticsearchIntegrationTest.*; import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.*; import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.MatcherAssert.assertThat; @@ -57,7 +58,6 @@ public class LicenseTransportTests extends ElasticsearchIntegrationTest { private static String pubKeyPath = null; private static String priKeyPath = null; - private static String keyPass = null; @Override protected Settings nodeSettings(int nodeOrdinal) { @@ -77,17 +77,13 @@ public class LicenseTransportTests extends ElasticsearchIntegrationTest { LicenseTransportTests.priKeyPath = privateKeyFile.getAbsolutePath(); assert privateKeyFile.delete(); assert publicKeyFile.delete(); - String keyPass = "password"; - LicenseTransportTests.keyPass = keyPass; // Generate keyPair - String[] args = new String[6]; + String[] args = new String[4]; args[0] = "--publicKeyPath"; args[1] = LicenseTransportTests.pubKeyPath; args[2] = "--privateKeyPath"; args[3] = LicenseTransportTests.priKeyPath; - args[4] = "--keyPass"; - args[5] = LicenseTransportTests.keyPass; KeyPairGeneratorTool.main(args); } @@ -112,15 +108,13 @@ public class LicenseTransportTests extends ElasticsearchIntegrationTest { String licenseString = TestUtils.generateESLicenses(map); - String[] args = new String[8]; + String[] args = new String[6]; args[0] = "--license"; args[1] = licenseString; args[2] = "--publicKeyPath"; args[3] = pubKeyPath; args[4] = "--privateKeyPath"; args[5] = priKeyPath; - args[6] = "--keyPass"; - args[7] = keyPass; String licenseOutput = TestUtils.runLicenseGenerationTool(args); @@ -141,6 +135,8 @@ public class LicenseTransportTests extends ElasticsearchIntegrationTest { final GetLicenseResponse getLicenseResponse = getLicenseFuture.get(); + assertThat(getLicenseResponse.licenses(), notNullValue()); + LicenseUtils.printLicense(getLicenseResponse.licenses()); }