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);