Browse Source

add message about transform disabled if license is missing (#46901)

adds a message for transform about what happens if no license has been activated
Hendrik Muhs 6 years ago
parent
commit
ddac3087c8

+ 5 - 1
x-pack/plugin/core/src/main/java/org/elasticsearch/license/XPackLicenseState.java

@@ -70,6 +70,10 @@ public class XPackLicenseState {
             "Creating and Starting rollup jobs will no longer be allowed.",
             "Stopping/Deleting existing jobs, RollupCaps API and RollupSearch continue to function."
         });
+        messages.put(XPackField.TRANSFORM, new String[] {
+            "Creating, starting, updating transforms will no longer be allowed.",
+            "Stopping/Deleting existing transforms continue to function."
+        });
         messages.put(XPackField.ANALYTICS, new String[] {
             "Aggregations provided by Data Science plugin are no longer usable."
         });
@@ -594,7 +598,7 @@ public class XPackLicenseState {
     }
 
     /**
-     * Data Frame is always available as long as there is a valid license
+     * Transform is always available as long as there is a valid license
      *
      * @return true if the license is active
      */

+ 11 - 0
x-pack/plugin/core/src/test/java/org/elasticsearch/license/XPackLicenseStateTests.java

@@ -491,4 +491,15 @@ public class XPackLicenseStateTests extends ESTestCase {
         assertAckMesssages(XPackField.SQL, randomTrialOrPlatinumMode(), randomBasicStandardOrGold(), 1);
     }
 
+    public void testTransformBasic() throws Exception {
+        assertAllowed(BASIC, true, XPackLicenseState::isTransformAllowed, true);
+    }
+
+    public void testTransformStandard() throws Exception {
+        assertAllowed(STANDARD, true, XPackLicenseState::isTransformAllowed, true);
+    }
+
+    public void testTransformInactiveBasic() {
+        assertAllowed(BASIC, false, XPackLicenseState::isTransformAllowed, false);
+    }
 }