use of org.wso2.carbon.identity.application.authentication.framework.exception.AuthenticationFailedException in project identity-outbound-auth-sms-otp by wso2-extensions.
the class SMSOTPUtilsTest method testGetNoOfDigitsFromRegistry.
@Test
public void testGetNoOfDigitsFromRegistry() throws AuthenticationFailedException {
AuthenticationContext authenticationContext = new AuthenticationContext();
authenticationContext.setTenantDomain("wso2.org");
authenticationContext.setProperty(SMSOTPConstants.NO_DIGITS, "4");
Assert.assertEquals(SMSOTPUtils.getNoOfDigits(authenticationContext, SMSOTPConstants.AUTHENTICATOR_NAME), "4");
}
use of org.wso2.carbon.identity.application.authentication.framework.exception.AuthenticationFailedException in project identity-outbound-auth-sms-otp by wso2-extensions.
the class SMSOTPUtilsTest method testGetLoginPageFromXMLFileFromRegistry.
@Test
public void testGetLoginPageFromXMLFileFromRegistry() throws AuthenticationFailedException {
AuthenticationContext authenticationContext = new AuthenticationContext();
authenticationContext.setTenantDomain("wso2.org");
authenticationContext.setProperty(SMSOTPConstants.SMSOTP_AUTHENTICATION_ENDPOINT_URL, SMSOTPConstants.SMS_LOGIN_PAGE);
Assert.assertEquals(SMSOTPUtils.getLoginPageFromXMLFile(authenticationContext, SMSOTPConstants.AUTHENTICATOR_NAME), "smsotpauthenticationendpoint/smsotp.jsp");
}
use of org.wso2.carbon.identity.application.authentication.framework.exception.AuthenticationFailedException in project identity-outbound-auth-sms-otp by wso2-extensions.
the class SMSOTPUtilsTest method testGetBackupCodeFromRegistry.
@Test
public void testGetBackupCodeFromRegistry() throws AuthenticationFailedException {
AuthenticationContext authenticationContext = new AuthenticationContext();
authenticationContext.setTenantDomain("wso2.org");
authenticationContext.setProperty(SMSOTPConstants.BACKUP_CODE, true);
Assert.assertEquals(SMSOTPUtils.getBackupCode(authenticationContext, SMSOTPConstants.AUTHENTICATOR_NAME), "true");
}
use of org.wso2.carbon.identity.application.authentication.framework.exception.AuthenticationFailedException in project identity-outbound-auth-sms-otp by wso2-extensions.
the class SMSOTPUtilsTest method testIsEnableMobileNoUpdateFromRegistry.
@Test
public void testIsEnableMobileNoUpdateFromRegistry() throws AuthenticationFailedException {
AuthenticationContext authenticationContext = new AuthenticationContext();
authenticationContext.setTenantDomain("wso2.org");
authenticationContext.setProperty(SMSOTPConstants.IS_ENABLE_MOBILE_NO_UPDATE, "true");
Assert.assertEquals(SMSOTPUtils.isEnableMobileNoUpdate(authenticationContext, SMSOTPConstants.AUTHENTICATOR_NAME), true);
}
use of org.wso2.carbon.identity.application.authentication.framework.exception.AuthenticationFailedException in project identity-outbound-auth-sms-otp by wso2-extensions.
the class SMSOTPUtilsTest method testIsEnableResendCodeFromRegistry.
@Test
public void testIsEnableResendCodeFromRegistry() throws AuthenticationFailedException {
AuthenticationContext authenticationContext = new AuthenticationContext();
authenticationContext.setTenantDomain("wso2.org");
authenticationContext.setProperty(SMSOTPConstants.IS_ENABLED_RESEND, "true");
Assert.assertEquals(SMSOTPUtils.isEnableResendCode(authenticationContext, SMSOTPConstants.AUTHENTICATOR_NAME), true);
}
Aggregations