Skip to content

Commit

Permalink
Mosip 39047 - Commons cleanup (#813)
Browse files Browse the repository at this point in the history
* MOSIP-39719

Signed-off-by: Nandhukumar <[email protected]>

* MOSIP-39047

Signed-off-by: Nandhukumar <[email protected]>

* MOSIP-39047

Signed-off-by: Nandhukumar <[email protected]>

* MOSIP-39047

Signed-off-by: Nandhukumar <[email protected]>

* MOSIP-39047

Signed-off-by: Nandhukumar <[email protected]>

* MOSIP-39047

Signed-off-by: Nandhukumar <[email protected]>

---------

Signed-off-by: Nandhukumar <[email protected]>
  • Loading branch information
nandhu-kumar authored Mar 3, 2025
1 parent 354422d commit ff087cb
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import com.nimbusds.jose.jwk.KeyUse;
import com.nimbusds.jose.jwk.RSAKey;

import io.mosip.testrig.apirig.dataprovider.BiometricDataProvider;
import io.mosip.testrig.apirig.dbaccess.DBManager;
import io.mosip.testrig.apirig.prereg.utils.PreRegConfigManager;
import io.mosip.testrig.apirig.prereg.utils.PreRegUtil;
import io.mosip.testrig.apirig.testrunner.BaseTestCase;
Expand Down Expand Up @@ -82,12 +84,18 @@ public static void main(String[] arg) {
AdminTestUtil.getRequiredField();

// For now we are not doing health check for qa-115.
if (BaseTestCase.isTargetEnvLTS()) {
HealthChecker healthcheck = new HealthChecker();
healthcheck.setCurrentRunningModule(BaseTestCase.currentModule);
Thread trigger = new Thread(healthcheck);
trigger.start();
}
// if (BaseTestCase.isTargetEnvLTS()) {
// HealthChecker healthcheck = new HealthChecker();
// healthcheck.setCurrentRunningModule(BaseTestCase.currentModule);
// Thread trigger = new Thread(healthcheck);
// trigger.start();
// }

HealthChecker healthcheck = new HealthChecker();
healthcheck.setCurrentRunningModule(BaseTestCase.currentModule);
Thread trigger = new Thread(healthcheck);
trigger.start();

KeycloakUserManager.removeUser();
KeycloakUserManager.createUsers();
KeycloakUserManager.closeKeycloakInstance();
Expand All @@ -101,8 +109,10 @@ public static void main(String[] arg) {

OTPListener.bTerminate = true;

if (BaseTestCase.isTargetEnvLTS())
HealthChecker.bTerminate = true;
// if (BaseTestCase.isTargetEnvLTS())
// HealthChecker.bTerminate = true;

HealthChecker.bTerminate = true;

System.exit(0);

Expand Down Expand Up @@ -137,6 +147,9 @@ private static void setLogLevels() {
KernelAuthentication.setLogLevel();
BaseTestCase.setLogLevel();
PreRegUtil.setLogLevel();
KeycloakUserManager.setLogLevel();
DBManager.setLogLevel();
BiometricDataProvider.setLogLevel();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import io.mosip.testrig.apirig.utils.RestClient;
import io.restassured.response.Response;

public class BookAppoinment extends AdminTestUtil implements ITest {
public class BookAppoinment extends PreRegUtil implements ITest {
private static final Logger logger = Logger.getLogger(BookAppoinment.class);
protected String testCaseName = "";
public String pathParams = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import io.mosip.testrig.apirig.utils.RestClient;
import io.restassured.response.Response;

public class BookAppoinmentByPrid extends AdminTestUtil implements ITest {
public class BookAppoinmentByPrid extends PreRegUtil implements ITest {
private static final Logger logger = Logger.getLogger(BookAppoinmentByPrid.class);
protected String testCaseName = "";
public Response response = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;

public class CreatePreReg extends AdminTestUtil implements ITest {
public class CreatePreReg extends PreRegUtil implements ITest {
private static final Logger logger = Logger.getLogger(CreatePreReg.class);
protected String testCaseName = "";
public String idKeyName = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;

public class DeleteWithParam extends AdminTestUtil implements ITest {
public class DeleteWithParam extends PreRegUtil implements ITest {
private static final Logger logger = Logger.getLogger(DeleteWithParam.class);
protected String testCaseName = "";
public Response response = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;

public class GetWithParam extends AdminTestUtil implements ITest {
public class GetWithParam extends PreRegUtil implements ITest {
private static final Logger logger = Logger.getLogger(GetWithParam.class);
protected String testCaseName = "";
public Response response = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;

public class GetWithParamForAutoGenId extends AdminTestUtil implements ITest {
public class GetWithParamForAutoGenId extends PreRegUtil implements ITest {
private static final Logger logger = Logger.getLogger(GetWithParamForAutoGenId.class);
protected String testCaseName = "";
public String idKeyName = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;

public class PostWithFormDataAndFileForNotificationAPI extends AdminTestUtil implements ITest {
public class PostWithFormDataAndFileForNotificationAPI extends PreRegUtil implements ITest {
private static final Logger logger = Logger.getLogger(PostWithFormDataAndFileForNotificationAPI.class);
protected String testCaseName = "";
String idKeyName = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;

public class PostWithFormPathParamAndFile extends AdminTestUtil implements ITest {
public class PostWithFormPathParamAndFile extends PreRegUtil implements ITest {
private static final Logger logger = Logger.getLogger(PostWithFormPathParamAndFile.class);
protected String testCaseName = "";
public String idKeyName = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;

public class PostWithPathParamsAndBody extends AdminTestUtil implements ITest {
public class PostWithPathParamsAndBody extends PreRegUtil implements ITest {
private static final Logger logger = Logger.getLogger(PostWithPathParamsAndBody.class);
protected String testCaseName = "";
public String pathParams = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.testng.internal.TestResult;

import io.mosip.testrig.apirig.dbaccess.AuditDBManager;
import io.mosip.testrig.apirig.dbaccess.DBManager;
import io.mosip.testrig.apirig.dto.OutputValidationDto;
import io.mosip.testrig.apirig.dto.TestCaseDTO;
import io.mosip.testrig.apirig.prereg.utils.PreRegConfigManager;
Expand All @@ -36,7 +37,7 @@
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.restassured.response.Response;

public class PreregAuditValidator extends AdminTestUtil implements ITest {
public class PreregAuditValidator extends PreRegUtil implements ITest {
private static final Logger logger = Logger.getLogger(PreregAuditValidator.class);
protected String testCaseName = "";
public static List<String> templateFields = new ArrayList<>();
Expand Down Expand Up @@ -86,7 +87,7 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad
+ "[email protected]" + "'";

logger.info(query);
Map<String, Object> response = AuditDBManager.executeQueryAndGetRecord(testCaseDTO.getRole(), query);
Map<String, Object> response = DBManager.executeQueryAndGetRecord(testCaseDTO.getRole(), query);

Map<String, List<OutputValidationDto>> objMap = new HashMap<>();
List<OutputValidationDto> objList = new ArrayList<>();
Expand Down Expand Up @@ -117,7 +118,7 @@ public void setResultTestName(ITestResult result) {
+ "[email protected]" + "'";

logger.info(deleteQuery);
AuditDBManager.executeQueryAndDeleteRecord("audit", deleteQuery);
DBManager.executeQueryAndDeleteRecord("audit", deleteQuery);
try {
Field method = TestResult.class.getDeclaredField("m_method");
method.setAccessible(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;

public class PutWithPathParam extends AdminTestUtil implements ITest {
public class PutWithPathParam extends PreRegUtil implements ITest {
private static final Logger logger = Logger.getLogger(PutWithPathParam.class);
protected String testCaseName = "";
public Response response = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;

public class SimplePost extends AdminTestUtil implements ITest {
public class SimplePost extends PreRegUtil implements ITest {
private static final Logger logger = Logger.getLogger(SimplePost.class);
protected String testCaseName = "";
public Response response = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;

public class UpdatePrereg extends AdminTestUtil implements ITest {
public class UpdatePrereg extends PreRegUtil implements ITest {
private static final Logger logger = Logger.getLogger(UpdatePrereg.class);
protected String testCaseName = "";
String pathParams = null;
Expand Down
30 changes: 15 additions & 15 deletions api-test/src/main/resources/config/application.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## End point(s) relative URLs
internalSignEndpoint=/idauthentication/v1/internal/jwtSign
signJsonPath=config/sign.json
#internalSignEndpoint=/idauthentication/v1/internal/jwtSign
#signJsonPath=config/sign.json
encryptionPath=v1/identity/encrypt?isInternal=false
internalEncryptionPath=v1/identity/encrypt?isInternal=true
encodePath=v1/identity/encode
Expand Down Expand Up @@ -47,19 +47,19 @@ validateSignatureUrl=v1/identity/validateSign
vciContextURL=https://www.w3.org/2018/credentials/v1

## Auto generated properties while running the test rig(s)
adminAutoGeneratedIdPropFileName=/admin/autoGeneratedId.properties
masterDataAutoGeneratedIdPropFileName=/masterdata/autoGeneratedId.properties
syncDataAutoGeneratedIdPropFileName=/syncdata/autoGeneratedId.properties
preregAutoGeneratedIdPropFileName=/preReg/autoGeneratedId.properties
partnerAutoGeneratedIdPropFileName=/partner/autoGeneratedId.properties
idrepoAutoGeneratedIdPropFileName=/idRepository/autoGeneratedId.properties
residentAutoGeneratedIdPropFileName=/resident/autoGeneratedId.properties
esignetAutoGeneratedIdPropFileName=/esignet/autoGeneratedId.properties
mimotoAutoGeneratedIdPropFileName=/mimoto/autoGeneratedId.properties
authAutoGeneratedIdPropFileName=/ida/autoGeneratedId.properties
prerequisiteAutoGeneratedIdPropFileName=/prerequisite/autoGeneratedId.properties
regProcAutoGeneratedIdPropFileName=/regProc/autoGeneratedId.properties
mobileIdAutoGeneratedIdPropFileName=/mobileId/autoGeneratedId.properties
#adminAutoGeneratedIdPropFileName=/admin/autoGeneratedId.properties
#masterDataAutoGeneratedIdPropFileName=/masterdata/autoGeneratedId.properties
#syncDataAutoGeneratedIdPropFileName=/syncdata/autoGeneratedId.properties
#preregAutoGeneratedIdPropFileName=/preReg/autoGeneratedId.properties
#partnerAutoGeneratedIdPropFileName=/partner/autoGeneratedId.properties
#idrepoAutoGeneratedIdPropFileName=/idRepository/autoGeneratedId.properties
#residentAutoGeneratedIdPropFileName=/resident/autoGeneratedId.properties
#esignetAutoGeneratedIdPropFileName=/esignet/autoGeneratedId.properties
#mimotoAutoGeneratedIdPropFileName=/mimoto/autoGeneratedId.properties
#authAutoGeneratedIdPropFileName=/ida/autoGeneratedId.properties
#prerequisiteAutoGeneratedIdPropFileName=/prerequisite/autoGeneratedId.properties
#regProcAutoGeneratedIdPropFileName=/regProc/autoGeneratedId.properties
#mobileIdAutoGeneratedIdPropFileName=/mobileId/autoGeneratedId.properties

## As below are non changble values, move these out from properties file
appIdForCertificate=IDA
Expand Down

0 comments on commit ff087cb

Please sign in to comment.