From 7065b2251bf0c55fd59b31c4eaadcbd9c1f739a8 Mon Sep 17 00:00:00 2001 From: shanggeeth Date: Thu, 1 Feb 2024 14:42:48 +0530 Subject: [PATCH] Modify unit tests to support GraalJs execution * Add config to switch between script engines in unit tests * Set Wrapper Factory based on the current script engine * Add new testng test suite got graal js based script execution related tests * Temporarily comment out GraphBasedSequenceHandlerClaimMappingsTest until fixed --- .../impl/GraalSelectAcrFromFunction.java | 1 - .../model/graph/JsGraalGraphBuilderTest.java | 2 +- ...GraphBasedSequenceHandlerAbstractTest.java | 47 ++++++++++++++-- ...BasedSequenceHandlerClaimMappingsTest.java | 28 ++++++++-- ...sedSequenceHandlerCustomFunctionsTest.java | 54 +++++++++++-------- ...GraphBasedSequenceHandlerLongWaitTest.java | 4 +- .../src/test/resources/testng.xml | 49 +++++++++++++---- 7 files changed, 143 insertions(+), 42 deletions(-) diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/GraalSelectAcrFromFunction.java b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/GraalSelectAcrFromFunction.java index bd8194ab6d45..7b6dfa349823 100644 --- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/GraalSelectAcrFromFunction.java +++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/GraalSelectAcrFromFunction.java @@ -24,7 +24,6 @@ import org.wso2.carbon.identity.application.authentication.framework.util.FrameworkConstants; import java.util.Collections; -import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.TreeMap; diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/java/org/wso2/carbon/identity/application/authentication/framework/config/model/graph/JsGraalGraphBuilderTest.java b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/java/org/wso2/carbon/identity/application/authentication/framework/config/model/graph/JsGraalGraphBuilderTest.java index 04fa591d362f..9bb66c9ca1bb 100644 --- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/java/org/wso2/carbon/identity/application/authentication/framework/config/model/graph/JsGraalGraphBuilderTest.java +++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/java/org/wso2/carbon/identity/application/authentication/framework/config/model/graph/JsGraalGraphBuilderTest.java @@ -262,7 +262,7 @@ public Object[][] filterOptionsDataProvider() { {multipleOptionConfig, duplicateStepConfig(stepWithMultipleOptions), 3}, {multipleAndInvalidOptionConfig, duplicateStepConfig(stepWithMultipleOptions), 2}, {singleInvalidOptionConfig, duplicateStepConfig(stepWithMultipleOptions), 4}, - {idpOnlyOptionConfig, duplicateStepConfig(stepWithMultipleOptions), 2},}; + {idpOnlyOptionConfig, duplicateStepConfig(stepWithMultipleOptions), 2}, }; } private StepConfig duplicateStepConfig(StepConfig stepConfig) { diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/java/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/GraphBasedSequenceHandlerAbstractTest.java b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/java/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/GraphBasedSequenceHandlerAbstractTest.java index 30102c338a63..384a79d4d45c 100644 --- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/java/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/GraphBasedSequenceHandlerAbstractTest.java +++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/java/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/GraphBasedSequenceHandlerAbstractTest.java @@ -20,19 +20,30 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Parameters; +import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.identity.application.authentication.framework.AbstractFrameworkTest; import org.wso2.carbon.identity.application.authentication.framework.MockAuthenticator; import org.wso2.carbon.identity.application.authentication.framework.config.builder.FileBasedConfigurationBuilder; import org.wso2.carbon.identity.application.authentication.framework.config.loader.UIBasedConfigurationLoader; +import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.JSExecutionSupervisor; +import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.JsBaseGraphBuilderFactory; import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.JsFunctionRegistryImpl; import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.JsGraphBuilderFactory; +import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.JsWrapperFactory; +import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.JsWrapperFactoryProvider; +import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.graaljs.JsGraalGraphBuilderFactory; +import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.graaljs.JsGraalWrapperFactory; import org.wso2.carbon.identity.application.authentication.framework.context.AuthenticationContext; import org.wso2.carbon.identity.application.authentication.framework.handler.SubjectCallback; import org.wso2.carbon.identity.application.authentication.framework.internal.FrameworkServiceDataHolder; import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser; +import org.wso2.carbon.identity.application.authentication.framework.util.FrameworkConstants; import org.wso2.carbon.identity.application.common.model.ClaimMapping; import org.wso2.carbon.idp.mgt.IdentityProviderManager; import org.wso2.carbon.idp.mgt.dao.CacheBackedIdPMgtDAO; @@ -55,6 +66,7 @@ import static org.mockito.ArgumentMatchers.anyObject; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.doAnswer; +import static org.mockito.MockitoAnnotations.initMocks; import static org.powermock.api.mockito.PowerMockito.mock; public class GraphBasedSequenceHandlerAbstractTest extends AbstractFrameworkTest { @@ -68,13 +80,42 @@ public class GraphBasedSequenceHandlerAbstractTest extends AbstractFrameworkTest protected static final String TEST_USER_1_ID = "4b4414e1-916b-4475-aaee-6b0751c29ff6"; protected GraphBasedSequenceHandler graphBasedSequenceHandler = new GraphBasedSequenceHandler(); protected UIBasedConfigurationLoader configurationLoader; - protected JsGraphBuilderFactory graphBuilderFactory; + protected JsBaseGraphBuilderFactory graphBuilderFactory; + + @BeforeTest + public void setUpExecutionSupervisor() { + + initMocks(this); + JSExecutionSupervisor jsExecutionSupervisor = new JSExecutionSupervisor(1, 500000L); + FrameworkServiceDataHolder.getInstance().setJsExecutionSupervisor(jsExecutionSupervisor); + } + + @AfterTest + public void tearDownExecutionSupervisor() { + + FrameworkServiceDataHolder.getInstance().getJsExecutionSupervisor().shutdown(); + } @BeforeClass - protected void setupSuite() { + @Parameters({"scriptEngine"}) + protected void setupSuite(String scriptEngine) throws NoSuchFieldException, IllegalAccessException { configurationLoader = new UIBasedConfigurationLoader(); - graphBuilderFactory = new JsGraphBuilderFactory(); + CarbonConstants.ENABLE_LEGACY_AUTHZ_RUNTIME = false; + + if (scriptEngine.contentEquals(FrameworkConstants.JSAttributes.NASHORN)) { + graphBuilderFactory = new JsGraphBuilderFactory(); + } else if (scriptEngine.contentEquals(FrameworkConstants.JSAttributes.GRAALJS)) { + graphBuilderFactory = new JsGraalGraphBuilderFactory(); + } + + Field wrapperFactory = JsWrapperFactoryProvider.class.getDeclaredField("jsWrapperBaseFactory"); + wrapperFactory.setAccessible(true); + if (graphBuilderFactory instanceof JsGraphBuilderFactory) { + wrapperFactory.set(JsWrapperFactoryProvider.getInstance(), new JsWrapperFactory()); + } else if (graphBuilderFactory instanceof JsGraalGraphBuilderFactory) { + wrapperFactory.set(JsWrapperFactoryProvider.getInstance(), new JsGraalWrapperFactory()); + } JsFunctionRegistryImpl jsFunctionRegistry = new JsFunctionRegistryImpl(); FrameworkServiceDataHolder.getInstance().setJsFunctionRegistry(jsFunctionRegistry); diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/java/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/GraphBasedSequenceHandlerClaimMappingsTest.java b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/java/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/GraphBasedSequenceHandlerClaimMappingsTest.java index ed2239c19c50..829b3d58a00c 100644 --- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/java/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/GraphBasedSequenceHandlerClaimMappingsTest.java +++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/java/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/GraphBasedSequenceHandlerClaimMappingsTest.java @@ -18,6 +18,8 @@ package org.wso2.carbon.identity.application.authentication.framework.handler.sequence.impl; +import org.powermock.core.classloader.annotations.PowerMockIgnore; +import org.powermock.core.classloader.annotations.PrepareForTest; import org.testng.annotations.Test; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.identity.application.authentication.framework.config.model.SequenceConfig; @@ -29,9 +31,10 @@ import org.wso2.carbon.identity.common.testng.WithH2Database; import org.wso2.carbon.identity.common.testng.WithRealmService; import org.wso2.carbon.identity.common.testng.realm.UserStoreModel; +import org.wso2.carbon.identity.core.IdentityClaimManager; import org.wso2.carbon.identity.core.internal.IdentityCoreServiceDataHolder; +import org.wso2.carbon.user.core.claim.Claim; import org.wso2.carbon.user.core.service.RealmService; -import org.wso2.carbon.user.core.util.UserCoreUtil; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; import java.util.Collections; @@ -39,13 +42,18 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import static org.mockito.Mockito.mock; +import static org.mockito.ArgumentMatchers.any; +import static org.powermock.api.mockito.PowerMockito.mock; +import static org.powermock.api.mockito.PowerMockito.mockStatic; +import static org.powermock.api.mockito.PowerMockito.when; import static org.testng.Assert.assertEquals; /** * Tests the claim handling in the Javascript. */ @Test +@PowerMockIgnore({"javax.xml.*", "org.mockito.*", "org.apache.*", "org.w3c.*", }) +@PrepareForTest({IdentityClaimManager.class}) @WithH2Database(jndiName = "jdbc/WSO2IdentityDB", files = {"dbScripts/h2.sql"}) @WithCarbonHome @WithRealmService(injectToSingletons = @@ -72,7 +80,21 @@ public void testHandleClaimHandling() throws Exception { HttpServletResponse resp = mock(HttpServletResponse.class); - UserCoreUtil.setDomainInThreadLocal("test_domain"); + Claim[] supportedClaims = new Claim[3]; + Claim firstNameClaim = new Claim(); + firstNameClaim.setClaimUri("http://wso2.org/claims/givenname"); + supportedClaims[0] = firstNameClaim; + Claim lastNameClaim = new Claim(); + lastNameClaim.setClaimUri("http://wso2.org/claims/lastname"); + supportedClaims[1] = lastNameClaim; + Claim displayNameClaim = new Claim(); + displayNameClaim.setClaimUri("http://wso2.org/claims/displayName"); + supportedClaims[2] = displayNameClaim; + + mockStatic(IdentityClaimManager.class); + IdentityClaimManager identityClaimManager = mock(IdentityClaimManager.class); + when(IdentityClaimManager.getInstance()).thenReturn(identityClaimManager); + when(identityClaimManager.getAllSupportedClaims(any())).thenReturn(supportedClaims); RealmService currentRealmService = FrameworkServiceDataHolder.getInstance().getRealmService(); diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/java/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/GraphBasedSequenceHandlerCustomFunctionsTest.java b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/java/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/GraphBasedSequenceHandlerCustomFunctionsTest.java index 815ad3375dde..cdf964d48424 100644 --- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/java/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/GraphBasedSequenceHandlerCustomFunctionsTest.java +++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/java/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/GraphBasedSequenceHandlerCustomFunctionsTest.java @@ -29,7 +29,7 @@ import org.wso2.carbon.identity.application.authentication.framework.MockAuthenticator; import org.wso2.carbon.identity.application.authentication.framework.config.model.SequenceConfig; import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.JsFunctionRegistryImpl; -import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.nashorn.JsNashornAuthenticationContext; +import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.js.base.JsBaseAuthenticationContext; import org.wso2.carbon.identity.application.authentication.framework.context.AuthHistory; import org.wso2.carbon.identity.application.authentication.framework.context.AuthenticationContext; import org.wso2.carbon.identity.application.authentication.framework.exception.AuthenticationFailedException; @@ -72,17 +72,17 @@ @WithRegistry(injectToSingletons = {FrameworkServiceDataHolder.class}) public class GraphBasedSequenceHandlerCustomFunctionsTest extends GraphBasedSequenceHandlerAbstractTest { - public static String customFunction1(JsNashornAuthenticationContext context) { + public static String customFunction1(JsBaseAuthenticationContext context) { return "testResult1"; } - public static Boolean customBoolean(JsNashornAuthenticationContext context) { + public static Boolean customBoolean(JsBaseAuthenticationContext context) { return true; } - public static Boolean customBoolean2(JsNashornAuthenticationContext context, String value) { + public static Boolean customBoolean2(JsBaseAuthenticationContext context, String value) { return true; } @@ -94,7 +94,7 @@ public void testHandleDynamicJavascript1() throws Exception { JsFunctionRegistryImpl jsFunctionRegistrar = new JsFunctionRegistryImpl(); FrameworkServiceDataHolder.getInstance().setJsFunctionRegistry(jsFunctionRegistrar); jsFunctionRegistrar.register(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "fn1", - (Function) GraphBasedSequenceHandlerCustomFunctionsTest + (Function) GraphBasedSequenceHandlerCustomFunctionsTest ::customFunction1); jsFunctionRegistrar.register(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "fn2", new CustomFunctionImpl2()); @@ -117,16 +117,13 @@ public void testHandleDynamicBoolean() throws Exception { JsFunctionRegistry jsFunctionRegistrar = new JsFunctionRegistryImpl(); FrameworkServiceDataHolder.getInstance().setJsFunctionRegistry(jsFunctionRegistrar); jsFunctionRegistrar.register(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "fn1", - (Function) GraphBasedSequenceHandlerCustomFunctionsTest + (Function) GraphBasedSequenceHandlerCustomFunctionsTest ::customFunction1); jsFunctionRegistrar.register(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "getTrueFunction", - (Function) GraphBasedSequenceHandlerCustomFunctionsTest + (Function) GraphBasedSequenceHandlerCustomFunctionsTest ::customBoolean); - - jsFunctionRegistrar.register(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "getTrueFunction2", - (BiFunction) - GraphBasedSequenceHandlerCustomFunctionsTest - ::customBoolean2); + CustomBoolean2Impl customBoolean2 = new CustomBoolean2Impl(); + jsFunctionRegistrar.register(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "getTrueFunction2", customBoolean2); ServiceProvider sp1 = getTestServiceProvider("js-sp-dynamic-1.xml"); @@ -169,14 +166,14 @@ public void testHandleDynamicOnFail() throws Exception { JsFunctionRegistryImpl jsFunctionRegistrar = new JsFunctionRegistryImpl(); FrameworkServiceDataHolder.getInstance().setJsFunctionRegistry(jsFunctionRegistrar); jsFunctionRegistrar.register(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "fn1", - (Function) GraphBasedSequenceHandlerCustomFunctionsTest + (Function) GraphBasedSequenceHandlerCustomFunctionsTest ::customFunction1); jsFunctionRegistrar.register(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "getTrueFunction", - (Function) GraphBasedSequenceHandlerCustomFunctionsTest + (Function) GraphBasedSequenceHandlerCustomFunctionsTest ::customBoolean); jsFunctionRegistrar.register(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "getTrueFunction2", - (BiFunction) + (BiFunction) GraphBasedSequenceHandlerCustomFunctionsTest ::customBoolean2); @@ -203,14 +200,14 @@ public void testHandleDynamicOnFallback() throws Exception { JsFunctionRegistryImpl jsFunctionRegistrar = new JsFunctionRegistryImpl(); FrameworkServiceDataHolder.getInstance().setJsFunctionRegistry(jsFunctionRegistrar); jsFunctionRegistrar.register(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "fn1", - (Function) GraphBasedSequenceHandlerCustomFunctionsTest + (Function) GraphBasedSequenceHandlerCustomFunctionsTest ::customFunction1); jsFunctionRegistrar.register(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "getTrueFunction", - (Function) GraphBasedSequenceHandlerCustomFunctionsTest + (Function) GraphBasedSequenceHandlerCustomFunctionsTest ::customBoolean); jsFunctionRegistrar.register(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "getTrueFunction2", - (BiFunction) + (BiFunction) GraphBasedSequenceHandlerCustomFunctionsTest ::customBoolean2); @@ -235,7 +232,7 @@ public void testHandleDynamicJavascriptSerialization() throws Exception { JsFunctionRegistry jsFunctionRegistrar = new JsFunctionRegistryImpl(); FrameworkServiceDataHolder.getInstance().setJsFunctionRegistry(jsFunctionRegistrar); jsFunctionRegistrar.register(JsFunctionRegistry.Subsystem.SEQUENCE_HANDLER, "fn1", - (Function) GraphBasedSequenceHandlerCustomFunctionsTest + (Function) GraphBasedSequenceHandlerCustomFunctionsTest ::customFunction1); ServiceProvider sp1 = getTestServiceProvider("js-sp-dynamic-1.xml"); @@ -278,6 +275,7 @@ private AuthenticationContext processSequenceWithAcr(String[] acrArray) return processAndGetAuthenticationContext(acrArray, sp1); } + // private AuthenticationContext processAndGetAuthenticationContext(String[] acrArray, ServiceProvider sp1) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, FrameworkException { @@ -330,10 +328,16 @@ public Object answer(InvocationOnMock invocation) throws Throwable { }).when(request).getAttribute(Mockito.anyString()); } + @FunctionalInterface + public interface CustomBoolean2Interface extends Serializable { + + boolean getTrueFunction2(JsBaseAuthenticationContext context, String param1); + } + @FunctionalInterface public interface CustomFunctionInterface2 extends Serializable { - String customFunction2(JsNashornAuthenticationContext context, String param1, String param2); + String customFunction2(JsBaseAuthenticationContext context, String param1, String param2); } public static class MockFailingAuthenticator extends MockAuthenticator { @@ -370,9 +374,17 @@ public AuthenticatorFlowStatus process(HttpServletRequest request, HttpServletRe public class CustomFunctionImpl2 implements CustomFunctionInterface2 { - public String customFunction2(JsNashornAuthenticationContext context, String param1, String param2) { + public String customFunction2(JsBaseAuthenticationContext context, String param1, String param2) { return "testResult2"; } } + + public class CustomBoolean2Impl implements CustomBoolean2Interface { + + public boolean getTrueFunction2(JsBaseAuthenticationContext context, String param1) { + + return true; + } + } } diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/java/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/GraphBasedSequenceHandlerLongWaitTest.java b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/java/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/GraphBasedSequenceHandlerLongWaitTest.java index 840b32d4d1ca..138f157fc7ec 100644 --- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/java/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/GraphBasedSequenceHandlerLongWaitTest.java +++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/java/org/wso2/carbon/identity/application/authentication/framework/handler/sequence/impl/GraphBasedSequenceHandlerLongWaitTest.java @@ -24,7 +24,7 @@ import org.wso2.carbon.identity.application.authentication.framework.JsFunctionRegistry; import org.wso2.carbon.identity.application.authentication.framework.config.model.SequenceConfig; import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.JsFunctionRegistryImpl; -import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.JsNashornGraphBuilder; +import org.wso2.carbon.identity.application.authentication.framework.config.model.graph.JsGraphBuilder; import org.wso2.carbon.identity.application.authentication.framework.context.AuthenticationContext; import org.wso2.carbon.identity.application.authentication.framework.dao.impl.CacheBackedLongWaitStatusDAO; import org.wso2.carbon.identity.application.authentication.framework.dao.impl.LongWaitStatusDAOImpl; @@ -104,7 +104,7 @@ public void publishEvent(String siddhiAppName, String inStreamName, String outSt AsyncProcess asyncProcess = new AsyncProcess((ctx, r) -> { r.accept(ctx, Collections.emptyMap(), "onSuccess"); }); - JsNashornGraphBuilder.addLongWaitProcess(asyncProcess, eventHandlers); + JsGraphBuilder.addLongWaitProcess(asyncProcess, eventHandlers); } } } diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/testng.xml b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/testng.xml index 7711b011eb30..d41786b1cfef 100644 --- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/testng.xml +++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/test/resources/testng.xml @@ -32,15 +32,8 @@ - - - - - - - - - + + @@ -55,8 +48,11 @@ - - + + + + + @@ -68,6 +64,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +