diff --git a/src/main/java/org/opensearch/security/setting/DeprecatedSettings.java b/src/main/java/org/opensearch/security/setting/DeprecatedSettings.java index 947b7b8add..e5ec33300a 100644 --- a/src/main/java/org/opensearch/security/setting/DeprecatedSettings.java +++ b/src/main/java/org/opensearch/security/setting/DeprecatedSettings.java @@ -5,6 +5,7 @@ package org.opensearch.security.setting; +import org.opensearch.Version; import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.settings.Settings; @@ -35,7 +36,7 @@ public static void checkForDeprecatedSetting(final Settings settings, final Stri public static void logCustomDeprecationMessage(final String deprecationLocationInformation, final String deprecatedSettingKey) { DEPRECATION_LOGGER.deprecate( deprecatedSettingKey, - "In OpenSearch v2.0.0+ the setting '{}' is deprecated, it should be removed from the relevant config file using the following location information: " + "In OpenSearch " + Version.CURRENT + " the setting '{}' is deprecated, it should be removed from the relevant config file using the following location information: " + deprecationLocationInformation, deprecatedSettingKey ); diff --git a/src/test/java/org/opensearch/security/setting/DeprecatedSettingsTest.java b/src/test/java/org/opensearch/security/setting/DeprecatedSettingsTest.java index 5504f0d8be..d2a4fd8b4e 100644 --- a/src/test/java/org/opensearch/security/setting/DeprecatedSettingsTest.java +++ b/src/test/java/org/opensearch/security/setting/DeprecatedSettingsTest.java @@ -10,7 +10,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; - +import org.opensearch.Version; import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.settings.Settings; import org.opensearch.security.securityconf.impl.CType; @@ -103,12 +103,12 @@ public void testForTransportEnabledDeprecationMessageOnYamlLoad() throws Excepti ); verify(logger).deprecate( "transport_enabled", - "In OpenSearch v2.0.0+ the setting '{}' is deprecated, it should be removed from the relevant config file using the following location information: In AuthcDomain, using http_authenticator=HttpAuthenticator [challenge=true, type=null, config={}], authentication_backend=AuthcBackend [type=org.opensearch.security.auth.internal.InternalAuthenticationBackend, config={}]", + "In OpenSearch " + Version.CURRENT + " the setting '{}' is deprecated, it should be removed from the relevant config file using the following location information: In AuthcDomain, using http_authenticator=HttpAuthenticator [challenge=true, type=null, config={}], authentication_backend=AuthcBackend [type=org.opensearch.security.auth.internal.InternalAuthenticationBackend, config={}]", "transport_enabled" ); verify(logger).deprecate( "transport_enabled", - "In OpenSearch v2.0.0+ the setting '{}' is deprecated, it should be removed from the relevant config file using the following location information: In AuthzDomain, using authorization_backend=AuthzBackend [type=noop, config={}]", + "In OpenSearch " + Version.CURRENT + " the setting '{}' is deprecated, it should be removed from the relevant config file using the following location information: In AuthzDomain, using authorization_backend=AuthzBackend [type=noop, config={}]", "transport_enabled" ); }