diff --git a/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/model/UserDefinedFederatedAuthenticatorConfig.java b/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/model/UserDefinedFederatedAuthenticatorConfig.java index 0397b9182c9d..f91d7d1714a6 100644 --- a/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/model/UserDefinedFederatedAuthenticatorConfig.java +++ b/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/model/UserDefinedFederatedAuthenticatorConfig.java @@ -20,13 +20,13 @@ import org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.DefinedByType; +import static org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.TAG_CUSTOM; + /** * The user defined federated authenticator configuration model. */ public class UserDefinedFederatedAuthenticatorConfig extends FederatedAuthenticatorConfig { - private static final String TAG_CUSTOM = "CUSTOM"; - private UserDefinedAuthenticatorEndpointConfig endpointConfig; public UserDefinedFederatedAuthenticatorConfig() { diff --git a/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/model/UserDefinedLocalAuthenticatorConfig.java b/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/model/UserDefinedLocalAuthenticatorConfig.java index 31dff8247bd8..75a9a3114eda 100644 --- a/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/model/UserDefinedLocalAuthenticatorConfig.java +++ b/components/application-mgt/org.wso2.carbon.identity.application.common/src/main/java/org/wso2/carbon/identity/application/common/model/UserDefinedLocalAuthenticatorConfig.java @@ -21,13 +21,14 @@ import org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.AuthenticationType; import org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.DefinedByType; +import static org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.TAG_2FA; +import static org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.TAG_CUSTOM; + /** * The user defined local authenticator configuration model. */ public class UserDefinedLocalAuthenticatorConfig extends LocalAuthenticatorConfig { - private static final String TAG_2FA = "2FA"; - private static final String TAG_CUSTOM = "CUSTOM"; private AuthenticationType authenticationType; private UserDefinedAuthenticatorEndpointConfig endpointConfig; diff --git a/components/application-mgt/org.wso2.carbon.identity.application.common/src/test/java/org/wso2/carbon/identity/application/common/model/test/UserDefinedAuthenticatorTest.java b/components/application-mgt/org.wso2.carbon.identity.application.common/src/test/java/org/wso2/carbon/identity/application/common/model/test/UserDefinedAuthenticatorTest.java index 61c115d3dc94..97fcc362417a 100644 --- a/components/application-mgt/org.wso2.carbon.identity.application.common/src/test/java/org/wso2/carbon/identity/application/common/model/test/UserDefinedAuthenticatorTest.java +++ b/components/application-mgt/org.wso2.carbon.identity.application.common/src/test/java/org/wso2/carbon/identity/application/common/model/test/UserDefinedAuthenticatorTest.java @@ -29,6 +29,8 @@ import java.util.HashMap; import static org.testng.Assert.assertEquals; +import static org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.TAG_2FA; +import static org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.TAG_CUSTOM; public class UserDefinedAuthenticatorTest { @@ -39,7 +41,7 @@ public void createUserDefinedLocalVerificationAuthenticator() { UserDefinedLocalAuthenticatorConfig config = new UserDefinedLocalAuthenticatorConfig(AuthenticatorPropertyConstants.AuthenticationType.VERIFICATION); - assertEquals(config.getTags(), new String[]{"CUSTOM", "2FA"}); + assertEquals(config.getTags(), new String[]{TAG_CUSTOM, TAG_2FA}); assertEquals(config.getDefinedByType(), AuthenticatorPropertyConstants.DefinedByType.USER); } @@ -49,7 +51,7 @@ public void createUserDefinedLocalIdentificationAuthenticator() { UserDefinedLocalAuthenticatorConfig config = new UserDefinedLocalAuthenticatorConfig( AuthenticatorPropertyConstants.AuthenticationType.IDENTIFICATION); - assertEquals(config.getTags(), new String[]{"CUSTOM"}); + assertEquals(config.getTags(), new String[]{TAG_CUSTOM}); assertEquals(config.getDefinedByType(), AuthenticatorPropertyConstants.DefinedByType.USER); } @@ -57,7 +59,7 @@ public void createUserDefinedLocalIdentificationAuthenticator() { public void createUserDefinedFederatedAuthenticator() { UserDefinedFederatedAuthenticatorConfig config = new UserDefinedFederatedAuthenticatorConfig(); - assertEquals(config.getTags(), new String[]{"CUSTOM"}); + assertEquals(config.getTags(), new String[]{TAG_CUSTOM}); assertEquals(config.getDefinedByType(), AuthenticatorPropertyConstants.DefinedByType.USER); } diff --git a/components/identity-core/org.wso2.carbon.identity.base/src/main/java/org/wso2/carbon/identity/base/AuthenticatorPropertyConstants.java b/components/identity-core/org.wso2.carbon.identity.base/src/main/java/org/wso2/carbon/identity/base/AuthenticatorPropertyConstants.java index a887fd052c80..4b796e87bd0a 100644 --- a/components/identity-core/org.wso2.carbon.identity.base/src/main/java/org/wso2/carbon/identity/base/AuthenticatorPropertyConstants.java +++ b/components/identity-core/org.wso2.carbon.identity.base/src/main/java/org/wso2/carbon/identity/base/AuthenticatorPropertyConstants.java @@ -20,6 +20,9 @@ public class AuthenticatorPropertyConstants { + public static final String TAG_2FA = "2FA"; + public static final String TAG_CUSTOM = "Custom"; + /** * The Defined by Types - SYSTEM: system define authenticator, USER: user defined authentication extension. */