From f4141dab878f5accf163dbd8b811c08b240f03d2 Mon Sep 17 00:00:00 2001 From: Mohanachandran S Date: Tue, 24 Sep 2024 14:32:45 +0530 Subject: [PATCH] MOSIP-35886 - Modified the injection of Auth Demo Service utils Signed-off-by: Mohanachandran S --- apitest/entrypoint.sh | 2 +- .../io/mosip/testrig/apirig/testscripts/BioAuth.java | 8 ++------ .../mosip/testrig/apirig/testscripts/DemoAuth.java | 6 +----- .../apirig/testscripts/MultiFactorAuthNew.java | 12 ++---------- .../mosip/testrig/apirig/testscripts/OtpAuthNew.java | 8 +------- 5 files changed, 7 insertions(+), 29 deletions(-) diff --git a/apitest/entrypoint.sh b/apitest/entrypoint.sh index d6c99fcd02d..d2409087a17 100644 --- a/apitest/entrypoint.sh +++ b/apitest/entrypoint.sh @@ -1,4 +1,4 @@ #!/bin/bash ## Run automationtests -java -jar -Dmodules="$MODULES" -Denv.user="$ENV_USER" -Denv.endpoint="$ENV_ENDPOINT" -Denv.testLevel="$ENV_TESTLEVEL" apitest-auth-*-jar-with-dependencies.jar; +java -Dmodules="$MODULES" -Denv.user="$ENV_USER" -Denv.endpoint="$ENV_ENDPOINT" -Denv.testLevel="$ENV_TESTLEVEL" -jar apitest-auth-*-jar-with-dependencies.jar; diff --git a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/BioAuth.java b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/BioAuth.java index 6e3e464b340..70bedb3ee3c 100644 --- a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/BioAuth.java +++ b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/BioAuth.java @@ -7,7 +7,6 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.json.JSONObject; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.testng.ITest; import org.testng.ITestContext; @@ -43,11 +42,8 @@ public class BioAuth extends AdminTestUtil implements ITest { public Response newResponse = null; public boolean isInternal = false; - @Autowired - private EncryptionDecrptionUtil encryptDecryptUtil; - - @Autowired - private BioDataUtility bioDataUtil; + private EncryptionDecrptionUtil encryptDecryptUtil = new EncryptionDecrptionUtil(); + private BioDataUtility bioDataUtil = new BioDataUtility(); @BeforeClass public static void setLogLevel() { diff --git a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/DemoAuth.java b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/DemoAuth.java index 47788b285b6..e821dcb515e 100644 --- a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/DemoAuth.java +++ b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/DemoAuth.java @@ -8,13 +8,11 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.json.JSONObject; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.testng.ITest; import org.testng.ITestContext; import org.testng.ITestResult; import org.testng.Reporter; -import org.testng.SkipException; import org.testng.annotations.AfterClass; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -26,7 +24,6 @@ import io.mosip.testrig.apirig.dto.OutputValidationDto; import io.mosip.testrig.apirig.dto.TestCaseDTO; import io.mosip.testrig.apirig.testrunner.BaseTestCase; -import io.mosip.testrig.apirig.testrunner.HealthChecker; import io.mosip.testrig.apirig.testrunner.JsonPrecondtion; import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; @@ -45,8 +42,7 @@ public class DemoAuth extends AdminTestUtil implements ITest { public Response response = null; public boolean isInternal = false; - @Autowired - private EncryptionDecrptionUtil encryptDecryptUtil; + private EncryptionDecrptionUtil encryptDecryptUtil = new EncryptionDecrptionUtil(); @BeforeClass public static void setLogLevel() { diff --git a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/MultiFactorAuthNew.java b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/MultiFactorAuthNew.java index b3762e12574..de7d9d25fde 100644 --- a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/MultiFactorAuthNew.java +++ b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/MultiFactorAuthNew.java @@ -2,21 +2,17 @@ import java.lang.reflect.Field; import java.util.Arrays; -import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.log4j.Level; import org.apache.log4j.Logger; -import org.json.JSONArray; import org.json.JSONObject; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.testng.ITest; import org.testng.ITestContext; import org.testng.ITestResult; import org.testng.Reporter; -import org.testng.SkipException; import org.testng.annotations.AfterClass; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -27,7 +23,6 @@ import io.mosip.testrig.apirig.dto.OutputValidationDto; import io.mosip.testrig.apirig.dto.TestCaseDTO; -import io.mosip.testrig.apirig.testrunner.HealthChecker; import io.mosip.testrig.apirig.testrunner.JsonPrecondtion; import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; @@ -46,11 +41,8 @@ public class MultiFactorAuthNew extends AdminTestUtil implements ITest { protected String testCaseName = ""; public Response response = null; - @Autowired - private EncryptionDecrptionUtil encryptDecryptUtil; - - @Autowired - private BioDataUtility bioDataUtil; + private EncryptionDecrptionUtil encryptDecryptUtil = new EncryptionDecrptionUtil(); + private BioDataUtility bioDataUtil = new BioDataUtility(); @BeforeClass public static void setLogLevel() { diff --git a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/OtpAuthNew.java b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/OtpAuthNew.java index 8d3ef0ecd7d..3b3c0424a3c 100644 --- a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/OtpAuthNew.java +++ b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/OtpAuthNew.java @@ -2,21 +2,17 @@ import java.lang.reflect.Field; -import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.log4j.Level; import org.apache.log4j.Logger; -import org.json.JSONException; import org.json.JSONObject; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.testng.ITest; import org.testng.ITestContext; import org.testng.ITestResult; import org.testng.Reporter; -import org.testng.SkipException; import org.testng.annotations.AfterClass; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; @@ -27,7 +23,6 @@ import io.mosip.testrig.apirig.dto.OutputValidationDto; import io.mosip.testrig.apirig.dto.TestCaseDTO; -import io.mosip.testrig.apirig.testrunner.HealthChecker; import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; @@ -47,8 +42,7 @@ public class OtpAuthNew extends AdminTestUtil implements ITest { public Response response = null; public boolean isInternal = false; - @Autowired - private EncryptionDecrptionUtil encryptDecryptUtil; + private EncryptionDecrptionUtil encryptDecryptUtil = new EncryptionDecrptionUtil(); @BeforeClass public static void setLogLevel() {