Skip to content

Commit

Permalink
Merge pull request mosip#1522 from Sohandey/develop
Browse files Browse the repository at this point in the history
MOSIP-34075
  • Loading branch information
lsivanand authored Jul 11, 2024
2 parents a0340cb + dd91731 commit 3e205d7
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@ public static void clearKeyManagerDbDataForPartnerRevamp() {
}
}
}
public static void clearIDADbDataForPartnerRevamp() {
Session session = null;
try {
session = getDataBaseConnection(ConfigManager.getIdaDbUrl(), ConfigManager.getIdaDbUser(),
ConfigManager.getPMSDbPass(), ConfigManager.getIdaDbSchema());
executeQueries(session, MosipTestRunner.getGlobalResourcePath() + "/" + "config/partnerRevampDataDeleteQueriesForIDA.txt");
} catch (Exception e) {
logger.error("Error:: While executing IDA DB Quiries." + e.getMessage());
} finally {
if (session != null) {
session.close();
}
}
}

public static void clearKeyManagerDbData() {
Session session = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -39,6 +40,8 @@
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.GlobalMethods;
import io.mosip.testrig.apirig.utils.KernelAuthentication;
import io.mosip.testrig.apirig.utils.KeycloakUserManager;
import io.mosip.testrig.apirig.utils.PartnerRegistration;
import io.mosip.testrig.apirig.utils.RestClient;
import io.restassured.RestAssured;
import io.restassured.response.Response;
Expand Down Expand Up @@ -184,6 +187,15 @@ public class BaseTestCase extends AbstractTestNGSpringContextTests {
MosipTestRunner.getGlobalResourcePath() + "/" + "config/Kernel.properties");

public static String currentRunningLanguage = "";

//Need to handle this
/*
* static String timeStamp =
* String.valueOf(Calendar.getInstance().getTimeInMillis()); static String
* partnerId = "Tech-1245"; static String emailId = "mosip_1" + timeStamp +
* "@gmail.com"; static String role = PartnerRegistration.partnerType;
*/


public static String getOSType() {
String type = System.getProperty("os.name");
Expand Down Expand Up @@ -315,7 +327,11 @@ public static void suiteSetup() {
BaseTestCase.currentModule = GlobalConstants.PARTNERNEW;
DBManager.clearPartnerRevampDbData();
DBManager.clearKeyManagerDbDataForPartnerRevamp();
//DBManager.clearKeyManagerDbData();
DBManager.clearIDADbDataForPartnerRevamp();
//KeycloakUserManager.createKeyCloakUsers(partnerId, emailId, role);



BaseTestCase.currentModule = GlobalConstants.PARTNERNEW;
setReportName(GlobalConstants.PARTNERNEW);
AdminTestUtil.copyPmsNewTestResource();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ public String getTokenByRole(String role, String tokenType) {
return zonalApproverCookie;
case "partnerrevamp":
if (!kernelCmnLib.isValidToken(partnerrevampCookie))
partnerrevampCookie = kernelAuthLib.getAuthForPartner();
partnerrevampCookie = kernelAuthLib.getAuthForPartnerRevamp();
return partnerrevampCookie;
case "partner":
if (!kernelCmnLib.isValidToken(partnerCookie))
partnerCookie = kernelAuthLib.getAuthForPartnerRevamp();
partnerCookie = kernelAuthLib.getAuthForPartner();
return partnerCookie;
case "partnernew":
if (!kernelCmnLib.isValidToken(partnerNewCookie))
Expand Down Expand Up @@ -296,7 +296,7 @@ public String getAuthForPartnerRevamp() {

request.put(GlobalConstants.APPID, ConfigManager.getPmsAppId());
request.put(GlobalConstants.PASSWORD, partner_password);
request.put(GlobalConstants.USER_NAME, BaseTestCase.currentModule + "-" + partner_revamp_userName);
request.put(GlobalConstants.USER_NAME, partner_revamp_userName);
JSONObject actualInternalrequest = getRequestJson(authInternalRequest);
if (BaseTestCase.isTargetEnvLTS()) {
request.put(GlobalConstants.CLIENTID, ConfigManager.getPmsClientId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ else if(needsToBeCreatedUser.equals("masterdata-220005")){

}

else if(needsToBeCreatedUser.equals("111999")){
moduleSpecificUser = needsToBeCreatedUser;

}

else {
moduleSpecificUser = BaseTestCase.currentModule +"-"+ needsToBeCreatedUser;
}
Expand Down
35 changes: 17 additions & 18 deletions apitest-commons/src/main/resources/config/Kernel.properties
Original file line number Diff line number Diff line change
Expand Up @@ -109,49 +109,49 @@ partner_revamp_userName=111999
partner_user_password=mosip123
mosip_pms_client_id=mosip-pms-client
mosip_partner_client_id=mosip-partner-client
mosip_partner_client_secret=vXS7WUyPDpfWYuoz
mosip_pms_client_secret=5Qj8vn989OL1Vlu6
mosip_partner_client_secret=
mosip_pms_client_secret=
policytest_password=mosip123
policytest_userName=111998
policytest_without_pmrole_userName=111887
#RESIDENT & IDA
mosip_resident_app_id=resident
mosip_resident_client_id=mosip-resident-client
mosip_resident_client_secret=SnZQ6nnVwN9YWvdM
mosip_resident_client_secret=
#IDREPO
mosip_idrepo_app_id=idrepo
mosip_idrepo_client_id=mosip-idrepo-client
mosip_idrepo_client_secret=AeM2TwFuuZygCuvO
mosip_idrepo_client_secret=
#admin
mosip_admin_app_id=admin
admin_password=mosip123
admin_userName=220005
mosip_admin_client_id=mosip-admin-client
mosip_admin_client_secret=Styop9nqkshXMTgj
mosip_admin_client_secret=
#admin
admin_zone_password=mosip123
admin_zone_userName=globaladmin
mosip_regclient_app_id=registrationclient
mosip_reg_client_id=mosip-reg-client
mosip_reg_client_secret=DLXygc82rkAkjrwV
mosip_reg_client_secret=
#admin
mosip_regprocclient_app_id=regproc
mosip_regproc_client_id=mosip-regproc-client
mosip_regproc_client_secret=eyeXdyhO0u2ETibw
mosip_regproc_client_secret=
#mparter_mobile
mpartner_default_mobile_client_id=mpartner-default-mobile
mpartner_default_mobile_secret=iCkj8BRZU6hP6MAN
mpartner_default_mobile_secret=




#This credentials are used to execute auth demo service
AuthClientID=mosip-resident-client
AuthClientSecret=SnZQ6nnVwN9YWvdM
AuthClientSecret=
AuthAppID=resident
mosip_hotlist_app_id=hotlist
mosip_hotlist_client_id=mosip-hotlist-client
mosip_hotlist_client_secret=TKyc4cqWymxjiLEsVydX4uME1xU3i9xl
mosip_hotlist_client_secret=
###Keycloak_User-Creation_Properties
#Dontchange the partner user_111997

Expand All @@ -162,16 +162,15 @@ roles.111995=PARTNER_ADMIN,default-roles-mosip


keycloak_UserName = admin
keycloak_Password = sMDr9Ainw9
keycloak_Password =

keycloak-external-url=https://iam.qa-inji.mosip.net
mosip_testrig_client_id=mosip-testrig-client
mosip_testrig_client_secret=AonuXbikoWmHP5ug
mosip_testrig_client_secret=

keycloak-realm-id=mosip
iam-users-to-create=111997,111998,220005,111992,globaladmin,111887,111999
#iam-users-to-create=111997,220005,111992
iam-users-password=mosip123,mosip123,mosip123,mosip123,mosip123
iam-users-to-create=111997,111998,220005,111992,globaladmin,111999,111887
iam-users-password=mosip123,mosip123,mosip123,mosip123,mosip123,mosip123,mosip123
roles.220005=GLOBAL_ADMIN,ID_AUTHENTICATION,REGISTRATION_ADMIN,REGISTRATION_SUPERVISOR,ZONAL_ADMIN
roles.111997=AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,POLICYMANAGER,REGISTRATION_SUPERVISOR
roles.111999=AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,POLICYMANAGER,REGISTRATION_SUPERVISOR
Expand All @@ -188,14 +187,14 @@ current_session_context_class=thread
#audit details
audit_url=jdbc:postgresql://qa-inji.mosip.net:5432/mosip_audit
audit_username=postgres
audit_password=2BhgiSpCaT
audit_password=
audit_default_schema=audit
#ida-partner details
DB_PORT=
installation-domain=
partner_url=jdbc:postgresql://qa-inji.mosip.net:5432/mosip_ida
partner_username=postgres
partner_password=2BhgiSpCaT
partner_password=
partner_default_schema=partner
reportLogPath=automationLogAndReport
#--------minio proprties----------------
Expand Down Expand Up @@ -223,7 +222,7 @@ hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.show_sql=true
hibernate.current_session_context_class=thread
db-su-user=postgres
postgres-password=2BhgiSpCaT
postgres-password=
pms_db_schema=pms
km_db_schema=keymgr
master_db_schema=master
Expand Down

0 comments on commit 3e205d7

Please sign in to comment.