Skip to content

Commit

Permalink
MOSIP-35871
Browse files Browse the repository at this point in the history
Signed-off-by: Pankaj Godiyal <[email protected]>
  • Loading branch information
pg-techno123 committed Sep 24, 2024
1 parent fa35fd2 commit b5748fa
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ public class BioAuthentication extends BaseTestCaseUtil implements StepInterface
List<Object> casesListUIN = null;
List<Object> casesListVID = null;

@Autowired
private BioAuth bioAuth;
BioAuth bioAuth = new BioAuth();

static {
if (ConfigManager.IsDebugEnabled())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ public class EkycBio extends BaseTestCaseUtil implements StepInterface {
List<Object> casesListUIN = null;
List<Object> casesListVID = null;

@Autowired
private BioAuth bioAuth;
BioAuth bioAuth = new BioAuth();

static {
if (ConfigManager.IsDebugEnabled())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ public class EkycDemo extends BaseTestCaseUtil implements StepInterface {
logger.setLevel(Level.ERROR);
}

@Autowired
private DemoAuth demoAuth;
DemoAuth demoAuth = new DemoAuth();

@Override
public void run() throws RigInternalError {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ public class EkycOtp extends BaseTestCaseUtil implements StepInterface {
logger.setLevel(Level.ERROR);
}

@Autowired
private OtpAuthNew otpauth;
OtpAuthNew otpauth = new OtpAuthNew();

@Override
public void run() throws RigInternalError, FeatureNotSupportedError {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,13 @@ public class MultiFactorAuthentication extends BaseTestCaseUtil implements StepI
String emailId = null;
List<String> idType = BaseTestCase.getSupportedIdTypesValueFromActuator();

@Autowired
private DemoAuth demoAuth;
DemoAuth demoAuth = new DemoAuth();

@Autowired
private BioAuth bioAuth;
BioAuth bioAuth = new BioAuth();

@Autowired
private OtpAuthNew otpauth;
OtpAuthNew otpauth = new OtpAuthNew();

@Autowired
private MultiFactorAuthNew multiFactorAuth;
MultiFactorAuthNew multiFactorAuth = new MultiFactorAuthNew();

static {
if (ConfigManager.IsDebugEnabled())
Expand All @@ -76,10 +72,6 @@ public class MultiFactorAuthentication extends BaseTestCaseUtil implements StepI

@Override
public void run() throws RigInternalError {
// AuthPartnerProcessor.startProcess();
// step.getScenario().getUinPersonaProp().put("2310290713",
// "C:\\\\Users\\\\user\\\\AppData\\\\Local\\\\Temp\\\\residents_8783170256176160783\\\\915849158491584.json");

List<String> demoFetchList = null;
TestCaseDTO test = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ public class OtpAuthentication extends BaseTestCaseUtil implements StepInterface
private static final String OTPAUTHYml = "idaData/OtpAuth/OtpAuth.yml";
Properties uinResidentDataPathFinalProps = new Properties();

@Autowired
private OtpAuthNew otpauth;
OtpAuthNew otpauth = new OtpAuthNew();

static {
if (ConfigManager.IsDebugEnabled())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.Assert;
Expand All @@ -47,7 +48,6 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.sun.management.OperatingSystemMXBean;

import io.mosip.testrig.apirig.admin.fw.config.BeanConfig;
import io.mosip.testrig.apirig.testrunner.BaseTestCase;
import io.mosip.testrig.apirig.testrunner.MosipTestRunner;
import io.mosip.testrig.apirig.utils.ConfigManager;
Expand All @@ -60,6 +60,7 @@
import io.mosip.testrig.dslrig.ivv.core.exceptions.RigInternalError;
import io.mosip.testrig.dslrig.ivv.core.utils.Utils;
import io.mosip.testrig.dslrig.ivv.dg.DataGenerator;
import io.mosip.testrig.dslrig.ivv.e2e.config.BeanConfig;
import io.mosip.testrig.dslrig.ivv.parser.Parser;

@ContextConfiguration(classes = { BeanConfig.class })
Expand All @@ -80,9 +81,6 @@ public class Orchestrator extends AbstractTestNGSpringContextTests {
public static long suiteMaxTimeInMillis = 7200000; // 2 hour in milliseconds
static AtomicInteger counterLock = new AtomicInteger(0); // enable fairness policy

@Autowired
private ApplicationContext context;

private HashMap<String, String> packages = new HashMap<String, String>() {
{
put("e2e", "io.mosip.testrig.dslrig.ivv.e2e.methods");
Expand Down Expand Up @@ -508,26 +506,30 @@ public void publishResult() {
return;
}



public StepInterface getInstanceOf(Scenario.Step step)
throws ClassNotFoundException, IllegalAccessException, InstantiationException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
String className = getPackage(step) + "." + step.getName().substring(0, 1).toUpperCase()
+ step.getName().substring(1);
// Load the class
Class<?> clazz = Class.forName(className);
// Use the new approach to create an instance
return (StepInterface) clazz.getDeclaredConstructor().newInstance();
}


/*
* public StepInterface getInstanceOf(Scenario.Step step) throws
* ClassNotFoundException, IllegalAccessException, InstantiationException {
* String className = getPackage(step) + "." + step.getName().substring(0,
* 1).toUpperCase() + step.getName().substring(1); // return (StepInterface)
* Class.forName(className).newInstance(); return (StepInterface)
* appContext.getBean(Class.forName(className)); }
* @SuppressWarnings("deprecation") public StepInterface
* getInstanceOf(Scenario.Step step) throws ClassNotFoundException,
* NoSuchMethodException, InvocationTargetException, InstantiationException,
* IllegalAccessException { String className = getPackage(step) + "." +
* step.getName().substring(0, 1).toUpperCase() + step.getName().substring(1);
* // Load the class Class<?> clazz = Class.forName(className); // Retrieve the
* bean from the Spring application context return (StepInterface)
* context.getBean(clazz); }
*/

@SuppressWarnings("deprecation")
public StepInterface getInstanceOf(Scenario.Step step) throws ClassNotFoundException, NoSuchMethodException,
InvocationTargetException, InstantiationException, IllegalAccessException {
String className = getPackage(step) + "." + step.getName().substring(0, 1).toUpperCase()
+ step.getName().substring(1);
// Load the class
Class<?> clazz = Class.forName(className);
// Retrieve the bean from the Spring application context
return (StepInterface) context.getBean(clazz);
}

private void configToSystemProperties() {
Set<String> keys = this.properties.stringPropertyNames();
for (String key : keys) {
Expand Down

0 comments on commit b5748fa

Please sign in to comment.