diff --git a/plugin/src/test/java/org/elasticsearch/license/LicensesManagerServiceTests.java b/plugin/src/test/java/org/elasticsearch/license/LicensesManagerServiceTests.java index a9dc86ee019..cb36d343d25 100644 --- a/plugin/src/test/java/org/elasticsearch/license/LicensesManagerServiceTests.java +++ b/plugin/src/test/java/org/elasticsearch/license/LicensesManagerServiceTests.java @@ -16,6 +16,7 @@ import org.elasticsearch.test.junit.annotations.TestLogging; import org.elasticsearch.xpack.XPackPlugin; import org.elasticsearch.xpack.XPackSettings; import org.elasticsearch.xpack.XPackSingleNodeTestCase; +import org.junit.Before; import java.util.Collection; import java.util.Collections; @@ -50,6 +51,11 @@ public class LicensesManagerServiceTests extends XPackSingleNodeTestCase { return true; } + @Before + public void waitForTrialLicenseToBeGenerated() throws Exception { + assertBusy(() -> assertNotNull(getInstanceFromNode(ClusterService.class).state().metaData().custom(LicensesMetaData.TYPE))); + } + public void testStoreAndGetLicenses() throws Exception { LicenseService licenseService = getInstanceFromNode(LicenseService.class); ClusterService clusterService = getInstanceFromNode(ClusterService.class);