From a02c11de1747fd6c3d6582239ef92862734215b6 Mon Sep 17 00:00:00 2001 From: Tim Vernum Date: Mon, 13 Jan 2020 14:51:23 +1100 Subject: [PATCH] Fix another broken test --- .../LicenseOperationModeUpdateTests.java | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicenseOperationModeUpdateTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicenseOperationModeUpdateTests.java index 20df885261fed..2ef2438123650 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicenseOperationModeUpdateTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicenseOperationModeUpdateTests.java @@ -35,15 +35,19 @@ public void init() throws Exception { public void testLicenseOperationModeUpdate() throws Exception { License.LicenseType type = randomFrom(License.LicenseType.values()); - License license = License.builder() - .uid("id") - .expiryDate(0) - .issueDate(0) - .issuedTo("elasticsearch") - .issuer("issuer") - .type(type) - .maxNodes(1) - .build(); + final License.Builder licenseBuilder = License.builder() + .uid("id") + .expiryDate(0) + .issueDate(0) + .issuedTo("elasticsearch") + .issuer("issuer") + .type(type); + if (type == License.LicenseType.ENTERPRISE) { + licenseBuilder.maxResourceUnits(1); + } else { + licenseBuilder.maxNodes(1); + } + License license = licenseBuilder.build(); assertThat(license.operationMode(), equalTo(License.OperationMode.resolve(type))); OperationModeFileWatcherTests.writeMode("gold", licenseModeFile);