diff --git a/core/src/main/java/org/mule/runtime/core/api/config/MuleProperties.java b/core/src/main/java/org/mule/runtime/core/api/config/MuleProperties.java index fbddd97a1066..920f5b64c7a6 100644 --- a/core/src/main/java/org/mule/runtime/core/api/config/MuleProperties.java +++ b/core/src/main/java/org/mule/runtime/core/api/config/MuleProperties.java @@ -229,6 +229,10 @@ public class MuleProperties { public static final String OBJECT_STATISTICS = "_muleStatistics"; public static final String OBJECT_RESOURCE_LOCATOR = "_muleResourceLocator"; public static final String OBJECT_ARTIFACT_AST = "_muleArtifactAst"; + /** + * @deprecated since 4.9 there are no uses of this constant + */ + @Deprecated public static final String COMPATIBILITY_PLUGIN_INSTALLED = "_compatibilityPluginInstalled"; public static final String MULE_PROFILING_SERVICE_KEY = "_muleProfilingService"; public static final String MULE_CORE_EVENT_TRACER_KEY = "_muleCoreEventTracer"; diff --git a/runtime-extension-model/pom.xml b/runtime-extension-model/pom.xml index 162da23c2326..fdfc32451517 100644 --- a/runtime-extension-model/pom.xml +++ b/runtime-extension-model/pom.xml @@ -19,7 +19,6 @@ --add-exports=org.mule.runtime.api/org.mule.runtime.internal.dsl=ALL-UNNAMED --add-exports=org.mule.runtime.extension.model/org.mule.runtime.config.internal.validation.test=ALL-UNNAMED --add-exports=org.mule.runtime.extensions.api/org.mule.runtime.extension.internal.loader=org.mule.runtime.extension.model - --add-exports=org.mule.runtime.extensions.api/org.mule.runtime.extension.internal.spi=ALL-UNNAMED --add-exports=org.mule.runtime.dsl.api/org.mule.runtime.dsl.internal.xml.parser=ALL-UNNAMED --add-exports=org.mule.runtime.artifact.ast/org.mule.runtime.ast.internal.dsl=ALL-UNNAMED ${surefire.args.base} diff --git a/runtime-extension-model/src/main/java/org/mule/runtime/config/internal/validation/AllComponentsBelongToSomeExtensionModel.java b/runtime-extension-model/src/main/java/org/mule/runtime/config/internal/validation/AllComponentsBelongToSomeExtensionModel.java index d723c882d839..fbc9b5815c22 100644 --- a/runtime-extension-model/src/main/java/org/mule/runtime/config/internal/validation/AllComponentsBelongToSomeExtensionModel.java +++ b/runtime-extension-model/src/main/java/org/mule/runtime/config/internal/validation/AllComponentsBelongToSomeExtensionModel.java @@ -7,7 +7,6 @@ package org.mule.runtime.config.internal.validation; import static org.mule.runtime.ast.api.validation.Validation.Level.ERROR; -import static org.mule.runtime.ast.api.validation.Validation.Level.WARN; import static org.mule.runtime.ast.api.validation.ValidationResultItem.create; import static java.lang.String.format; @@ -30,12 +29,6 @@ */ public class AllComponentsBelongToSomeExtensionModel implements Validation { - private final boolean shouldBeError; - - public AllComponentsBelongToSomeExtensionModel(boolean isCompatibilityPluginInstalled) { - this.shouldBeError = !isCompatibilityPluginInstalled; - } - @Override public String getName() { return "All components belong to some extension model"; @@ -48,7 +41,7 @@ public String getDescription() { @Override public Level getLevel() { - return shouldBeError ? ERROR : WARN; + return ERROR; } @Override diff --git a/runtime-extension-model/src/main/java/org/mule/runtime/config/internal/validation/CoreValidationsProvider.java b/runtime-extension-model/src/main/java/org/mule/runtime/config/internal/validation/CoreValidationsProvider.java index 72d573896408..e6a747804fcd 100644 --- a/runtime-extension-model/src/main/java/org/mule/runtime/config/internal/validation/CoreValidationsProvider.java +++ b/runtime-extension-model/src/main/java/org/mule/runtime/config/internal/validation/CoreValidationsProvider.java @@ -49,13 +49,9 @@ public class CoreValidationsProvider implements ValidationsProvider, ArtifactAst @Inject private ExpressionLanguage expressionLanguage; - @Inject - @Named("_compatibilityPluginInstalled") - private Optional compatibilityPluginInstalled; - @Override public List get() { - List validations = new ArrayList<>(asList(new AllComponentsBelongToSomeExtensionModel(isCompatibilityInstalled()), + List validations = new ArrayList<>(asList(new AllComponentsBelongToSomeExtensionModel(), new SingletonsAreNotRepeated(), new SingletonsPerFileAreNotRepeated(), new NamedTopLevelElementsHaveName(), @@ -127,10 +123,6 @@ public List get() { return validations; } - private boolean isCompatibilityInstalled() { - return compatibilityPluginInstalled != null && compatibilityPluginInstalled.isPresent(); - } - public static Level getExpressionSyntacticValidationErrorLevel(Optional featureFlaggingService) { // Honour the system property consistently with MuleConfiguration#isValidateExpressions boolean validateExpressions = true; @@ -158,7 +150,7 @@ public List getArtifactValidations() { new ConfigReferenceParametersStereotypesValidations(featureFlaggingService, ignoreParamsWithProperties, artifactAstDependencyGraphProviderForValidator), new ReferenceParametersStereotypesValidations(artifactAstDependencyGraphProviderForValidator), - new MelNotEnabled(isCompatibilityInstalled())); + new MelNotEnabled()); } @Override diff --git a/runtime-extension-model/src/main/java/org/mule/runtime/config/internal/validation/MelNotEnabled.java b/runtime-extension-model/src/main/java/org/mule/runtime/config/internal/validation/MelNotEnabled.java index d18b0fe93c06..7e84b1f02b43 100644 --- a/runtime-extension-model/src/main/java/org/mule/runtime/config/internal/validation/MelNotEnabled.java +++ b/runtime-extension-model/src/main/java/org/mule/runtime/config/internal/validation/MelNotEnabled.java @@ -31,12 +31,6 @@ */ public class MelNotEnabled implements ArtifactValidation { - private final boolean compatibilityInstalled; - - public MelNotEnabled(boolean compatibilityInstalled) { - this.compatibilityInstalled = compatibilityInstalled; - } - @Override public String getName() { return "MEL not enabled"; @@ -55,9 +49,7 @@ public Level getLevel() { @Override public List validateMany(ArtifactAst artifact) { - if (compatibilityInstalled) { - return singletonList(create(emptyList(), this, "Deployed artifact uses the compatibility plugin.")); - } else if (isMelDefault()) { + if (isMelDefault()) { return singletonList(create(emptyList(), this, "Runtime has the '" + MULE_MEL_AS_DEFAULT + "' system property set to true.")); } else { diff --git a/runtime-extension-model/src/test/java/org/mule/runtime/config/internal/validation/AllComponentsBelongToSomeExtensionModelTestCase.java b/runtime-extension-model/src/test/java/org/mule/runtime/config/internal/validation/AllComponentsBelongToSomeExtensionModelTestCase.java index 76d893631249..44c82bce7be1 100644 --- a/runtime-extension-model/src/test/java/org/mule/runtime/config/internal/validation/AllComponentsBelongToSomeExtensionModelTestCase.java +++ b/runtime-extension-model/src/test/java/org/mule/runtime/config/internal/validation/AllComponentsBelongToSomeExtensionModelTestCase.java @@ -6,11 +6,11 @@ */ package org.mule.runtime.config.internal.validation; -import static org.mule.test.allure.AllureConstants.MuleDsl.DslValidationStory.DSL_VALIDATION_STORY; import static org.mule.test.allure.AllureConstants.MuleDsl.MULE_DSL; +import static org.mule.test.allure.AllureConstants.MuleDsl.DslValidationStory.DSL_VALIDATION_STORY; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; -import static org.junit.Assert.assertThat; import org.mule.runtime.ast.api.validation.Validation; import org.mule.runtime.ast.api.validation.ValidationResultItem; @@ -18,9 +18,10 @@ import java.util.Optional; +import org.junit.Test; + import io.qameta.allure.Feature; import io.qameta.allure.Story; -import org.junit.Test; @Feature(MULE_DSL) @Story(DSL_VALIDATION_STORY) @@ -28,7 +29,7 @@ public class AllComponentsBelongToSomeExtensionModelTestCase extends AbstractCor @Override protected Validation getValidation() { - return new AllComponentsBelongToSomeExtensionModel(false); + return new AllComponentsBelongToSomeExtensionModel(); } @Test