Skip to content

Commit

Permalink
Merge remote-tracking branch 'mt-functional-repo1/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Saumya Saumya authored and Saumya Saumya committed Jan 3, 2020
2 parents e97d05b + 1f1450e commit e3c6bcf
Show file tree
Hide file tree
Showing 176 changed files with 5,622 additions and 15,970 deletions.
2 changes: 1 addition & 1 deletion automationtests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>io.mosip</groupId>
<artifactId>mosip-parent</artifactId>
<version>1.0.2</version>
<version>1.0.4</version>
</parent>
<properties>
<!-- kernel versions -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1236,4 +1236,16 @@ public void setSplitEncryptedData(String splitEncryptedData) {
// TODO Auto-generated method stub

}

@Override
public String getAuthManagerUserIdPwd() {
// TODO Auto-generated method stub
return null;
}

@Override
public void setAuthManagerUserIdPwd(String authManagerUserIdPwd) {
// TODO Auto-generated method stub

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static Map<String, List<OutputValidationDto>> verifyAuditTxn(File[] listO
auth_txn_file = FileUtil.getFileFromList(listOfFiles, keywordToFind);
Map<String, String> exp = AuthTestsUtil.getPropertyAsMap(auth_txn_file.getAbsolutePath());
Map<String, String> act = DbConnection.getDataForQuery(
"select request_dtimes,response_dtimes,id,request_trn_id,auth_type_code,status_code,status_comment,lang_code,ref_id_type,ref_id,cr_dtimes from ida.auth_transaction where request_trn_id = '"
"select requested_entity_name,requested_entity_id,requested_entity_type,request_dtimes,response_dtimes,id,request_trn_id,auth_type_code,status_code,status_comment,lang_code,ref_id_type,ref_id,cr_dtimes from ida.auth_transaction where request_trn_id = '"
+ exp.get("request_trn_id") + "' order by cr_dtimes desc limit 1",
"IDA");
AuthTestsUtil.generateMappingDic(auth_txn_file.getAbsolutePath().toString(), preconAuditKeywords(exp, act));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ protected static String getResponseWithCookieForIdaUinGenerator(String url, Stri
protected static String getResponseWithCookieForIdRepoUinGenerator(String url, String cookieName) {
try {
return RestClient.getRequestWithCookie(url, MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON,
cookieName, getAuthorizationCookie(IdRepoTestsUtil.getCookieRequestFilePathForUinGenerator(), getCookieUrlPath(), cookieName)).asString();
cookieName, getAuthorizationCookie(AuthTestsUtil.getCookieRequestFilePathForUinGenerator(), getCookieUrlPath(), cookieName)).asString();
} catch (Exception e) {
IDASCRIPT_LOGGER.error("Exception: " + e);
return e.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,15 @@ public class IdaRunConfig extends RunConfig{
private String idaInternalRetrieveAuthTypeStatusPathForVID;
private String cryptomanagerEncrypt;
private String splitEncryptedData;
private String authManagerUserIdPwd;


public String getAuthManagerUserIdPwd() {
return authManagerUserIdPwd;
}
public void setAuthManagerUserIdPwd(String authManagerUserIdPwd) {
this.authManagerUserIdPwd = authManagerUserIdPwd;
}
public String getSplitEncryptedData() {
return splitEncryptedData;
}
Expand Down Expand Up @@ -425,7 +432,7 @@ public void setConfig(String testDataPath,String testDataFileName,String testTy
setStoreUINDataPath(AuthTestsUtil.getPropertyValue("storeUINDataPath"));
setEncodeFilePath(AuthTestsUtil.getPropertyValue("encodeFilePath"));
setDecodeFilePath(AuthTestsUtil.getPropertyValue("decodeFilePath"));
setClientidsecretkey(AuthTestsUtil.getPropertyValue("clientidsecretkey"));
setClientidsecretkey(AuthTestsUtil.getPropertyValue("useridPwd"));
//loadingConfigFile
loadErrorsData(getErrorsConfigPath());
setUinIdentityMapper(AuthTestsUtil.getPropertyValue("uinIdentityMapper"));
Expand All @@ -437,6 +444,7 @@ public void setConfig(String testDataPath,String testDataFileName,String testTy
setIdaInternalRetrieveAuthTypeStatusPathForVID(AuthTestsUtil.getPropertyValue("internalRetrieveAuthTypeStatusPathForVID"));
setCryptomanagerEncrypt(AuthTestsUtil.getPropertyValue("cryptomanagerEncrypt"));
setSplitEncryptedData(AuthTestsUtil.getPropertyValue("splitEncryptedData"));
setAuthManagerUserIdPwd(AuthTestsUtil.getPropertyValue("useridPwd"));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,8 @@ public abstract class RunConfig {
public abstract void setCryptomanagerEncrypt(String cryptomanagerEncrypt);
public abstract String getSplitEncryptedData();
public abstract void setSplitEncryptedData(String splitEncryptedData);
public abstract String getAuthManagerUserIdPwd();
public abstract void setAuthManagerUserIdPwd(String authManagerUserIdPwd);

//Admin module
public abstract String getAdminEndPointUrl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.testng.annotations.BeforeClass;

import io.mosip.authentication.fw.util.AuthPartnerProcessor;
import io.mosip.authentication.fw.util.RunConfigUtil;

public class IdRepoPrerequisteTests extends IdRepoTestsUtil{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1257,4 +1257,16 @@ public String getFilterHolidaysPath() {
// TODO Auto-generated method stub
return null;
}

@Override
public String getAuthManagerUserIdPwd() {
// TODO Auto-generated method stub
return null;
}

@Override
public void setAuthManagerUserIdPwd(String authManagerUserIdPwd) {
// TODO Auto-generated method stub

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,6 @@ private static Properties getRunConfigData() {
public static String getPropertyValue(String key) {
return getRunConfigData().getProperty(key);
}
protected static String getCookieRequestFilePath() {
return RunConfigUtil.getResourcePath()
+ "idRepository/TestData/Security/GetCookie/getCookieRequest.json".toString();
}
public static String getCookieRequestFilePathForUinGenerator() {
return RunConfigUtil.getResourcePath()
+ "idRepository/TestData/Security/GetCookie/getCookieForUinGenerator.json".toString();
}

public static void copyIdrepoTestResource() {
try {
Expand Down Expand Up @@ -191,4 +183,24 @@ protected boolean postRequestAndGenerateOuputFileForUINUpdate(File[] listOfFiles
return false;
}
}

protected static String getCookieRequestFilePath() {
return RunConfigUtil.getResourcePath()
+ "idRepository/TestData/Security/GetCookie/"+RunConfigUtil.getRunEvironment()+".getCookieRequest.json".toString();
}

protected static String getCookieRequestFilePathForUinGenerator() {
return RunConfigUtil.getResourcePath()
+ "idRepository/TestData/Security/GetCookie/"+RunConfigUtil.getRunEvironment()+".getCookieForUinGenerator.json".toString();
}

protected static String getCookieRequestFilePathForInternalAuth() {
return RunConfigUtil.getResourcePath()
+ "idRepository/TestData/Security/GetCookie/"+RunConfigUtil.getRunEvironment()+".getCookieForInternalAuth.json".toString();
}

protected static String getCookieRequestFilePathForResidentAuth() {
return RunConfigUtil.getResourcePath()
+ "idRepository/TestData/Security/GetCookie/"+RunConfigUtil.getRunEvironment()+".residentServiceCredential.json".toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public void setResultTestName(ITestResult result) {
@Test(dataProvider = "testcaselist")
public void deactivateVIDsForUIN(TestParameters objTestParameters, String testScenario,
String testcaseName) throws IdRepositoryTestException {
cookieValue=getAuthorizationCookie(getCookieRequestFilePathForUinGenerator(),RunConfigUtil.objRunConfig.getIdRepoEndPointUrl()+RunConfigUtil.objRunConfig.getClientidsecretkey(),AUTHORIZATHION_COOKIENAME);
cookieValue=getAuthorizationCookie(getCookieRequestFilePathForResidentAuth(),RunConfigUtil.objRunConfig.getIdRepoEndPointUrl()+RunConfigUtil.objRunConfig.getClientidsecretkey(),AUTHORIZATHION_COOKIENAME);
File testCaseName = objTestParameters.getTestCaseFile();
int testCaseNumber = Integer.parseInt(objTestParameters.getTestId());
displayLog(testCaseName, testCaseNumber);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public void setResultTestName(ITestResult result) {
@Test(dataProvider = "testcaselist")
public void reactivateVIDsForUIN(TestParameters objTestParameters, String testScenario,
String testcaseName) throws IdRepositoryTestException {
cookieValue=getAuthorizationCookie(getCookieRequestFilePathForUinGenerator(),RunConfigUtil.objRunConfig.getIdRepoEndPointUrl()+RunConfigUtil.objRunConfig.getClientidsecretkey(),AUTHORIZATHION_COOKIENAME);
cookieValue=getAuthorizationCookie(getCookieRequestFilePathForResidentAuth(),RunConfigUtil.objRunConfig.getIdRepoEndPointUrl()+RunConfigUtil.objRunConfig.getClientidsecretkey(),AUTHORIZATHION_COOKIENAME);
File testCaseName = objTestParameters.getTestCaseFile();
int testCaseNumber = Integer.parseInt(objTestParameters.getTestId());
displayLog(testCaseName, testCaseNumber);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public String getTestName() {
@BeforeMethod
public void setTestCaseName() {
this.testCaseName = String.format("Verify Retrieve Identity By UIN");
RunConfigUtil.getRunConfigObject("idrepo");
RunConfigUtil.objRunConfig.setConfig("Dummy/Dummy", "Dummy", "");
}

@AfterMethod(alwaysRun = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import io.mosip.authentication.testdata.keywords.IdRepoKeywordUtil;
import io.mosip.authentication.testdata.keywords.IdaKeywordUtil;
import io.mosip.authentication.testdata.keywords.KeywordUtil;
import io.mosip.residentService.fw.util.ResidentServiceKeywordUtil;

/**
* Precondtion json file according to the input and mapping provided in test
Expand Down Expand Up @@ -158,6 +159,8 @@ else if (moduleName.equalsIgnoreCase("idrepo"))
objKeywordUtil = new IdRepoKeywordUtil();
else if (moduleName.equalsIgnoreCase("admin"))
objKeywordUtil = new AdminKeywordUtil();
else if (moduleName.equalsIgnoreCase("residentService"))
objKeywordUtil = new ResidentServiceKeywordUtil();
return objKeywordUtil;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ public CentetMachineUserMappingToMasterData()
public void getTestCaseName(Method method, Object[] testdata, ITestContext ctx) throws Exception {
String object = (String) testdata[0];
testCaseName = moduleName + "_" + apiName + "_" + object.toString();
if(!lib.isValidToken(regProcCookie))
regProcCookie = auth.getAuthForRegistrationProcessor();
if(!lib.isValidToken(adminCookie))
adminCookie = auth.getAuthForAdmin();
}

// Data Providers to read the input json files from the folders
Expand Down Expand Up @@ -95,7 +95,7 @@ public void centetMachineUserMappingToMasterData(String testcaseName)
actualRequest.put("requesttime", lib.getCurrentLocalTime());
}
// Calling the put method
Response response = applicationLibrary.putWithJson(CentetMachineUserMappingToMasterData_uri, actualRequest, regProcCookie);
Response response = applicationLibrary.putWithJson(CentetMachineUserMappingToMasterData_uri, actualRequest, adminCookie);

// Removing of unstable attributes from response
ArrayList<String> listOfElementToRemove=new ArrayList<String>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public class EncrptionDecryption extends BaseTestCase implements ITest {
public void getTestCaseName(Method method, Object[] testdata, ITestContext ctx) throws Exception {
String object = (String) testdata[0];
testCaseName = moduleName + "_" + apiName + "_" + object.toString();
if(!lib.isValidToken(regProcCookie))
regProcCookie = auth.getAuthForRegistrationProcessor();
if(!lib.isValidToken(adminCookie))
adminCookie = auth.getAuthForAdmin();
}

/**
Expand Down Expand Up @@ -133,7 +133,7 @@ public void encrptionDecryption(String testcaseName) throws ParseException {

logger.info("Json Request Is : " + objectData.toJSONString());

response = applicationLibrary.postWithJson(encrypt_URI, objectData.toJSONString(), regProcCookie);
response = applicationLibrary.postWithJson(encrypt_URI, objectData.toJSONString(), adminCookie);

//This method is for checking the authentication is pass or fail in rest services
new CommonLibrary().responseAuthValidation(response);
Expand Down Expand Up @@ -168,7 +168,7 @@ public void encrptionDecryption(String testcaseName) throws ParseException {
break;
}
objectData.put("request", request);
response = applicationLibrary.postWithJson(decrypt_URI, objectData.toJSONString(), regProcCookie);
response = applicationLibrary.postWithJson(decrypt_URI, objectData.toJSONString(), adminCookie);
statusCode = response.statusCode();
logger.info("Decryption Status Code is : " + statusCode);
//This method is for checking the authentication is pass or fail in rest services
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ public void getTestCaseName(Method method, Object[] testdata, ITestContext ctx)
throws JsonParseException, JsonMappingException, IOException, ParseException {
String object = (String) testdata[0];
testCaseName = moduleName + "_" + apiName + "_" + object.toString();
if(!lib.isValidToken(regAdminCookie))
regAdminCookie = auth.getAuthForRegistrationAdmin();
if(!lib.isValidToken(adminCookie))
adminCookie = auth.getAuthForAdmin();
}

/**
Expand Down Expand Up @@ -111,7 +111,7 @@ public void fetchBiometricAttribute(String testcaseName) throws ParseException {
JSONObject objectData = objectDataArray[0];
responseObject = objectDataArray[1];
// sending get request
response = applicationLibrary.getWithPathParam(FetchBiometricAttribute_URI, objectData, regAdminCookie);
response = applicationLibrary.getWithPathParam(FetchBiometricAttribute_URI, objectData, adminCookie);

// This method is for checking the authentication is pass or fail in rest
// services
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public class FetchBiometricAuthType extends BaseTestCase implements ITest {
public void getTestCaseName(Method method, Object[] testdata, ITestContext ctx) throws Exception {
String object = (String) testdata[0];
testCaseName = moduleName + "_" + apiName + "_" + object.toString();
if(!lib.isValidToken(zonalAdminCookie))
zonalAdminCookie = auth.getAuthForZonalAdmin();
if(!lib.isValidToken(adminCookie))
adminCookie = auth.getAuthForAdmin();
}

/**
Expand Down Expand Up @@ -111,7 +111,7 @@ public void fetchBiometricAuthType(String testcaseName) throws ParseException {
JSONObject objectData = objectDataArray[0];
responseObject = objectDataArray[1];
// sending get request
response = applicationLibrary.getWithPathParam(FetchBiometricAuthType_URI, objectData, zonalAdminCookie);
response = applicationLibrary.getWithPathParam(FetchBiometricAuthType_URI, objectData, adminCookie);
// DB validation

// This method is for checking the authentication is pass or fail in rest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ public class FetchBlackListedWord extends BaseTestCase implements ITest {
public void getTestCaseName(Method method, Object[] testdata, ITestContext ctx) throws Exception {
String object = (String) testdata[0];
testCaseName = moduleName+"_"+apiName+"_"+object.toString();
if(!lib.isValidToken(zonalAdminCookie))
zonalAdminCookie=auth.getAuthForZonalAdmin();
if(!lib.isValidToken(adminCookie))
adminCookie=auth.getAuthForAdmin();
}

/**
Expand Down Expand Up @@ -105,7 +105,7 @@ public void fetchBlackListedWord(String testcaseName){

JSONObject objectData = objectDataArray[0];
responseObject = objectDataArray[1];
response = applicationLibrary.getWithPathParam(FetchBlackListedWord_URI,objectData,zonalAdminCookie);
response = applicationLibrary.getWithPathParam(FetchBlackListedWord_URI,objectData,adminCookie);

// add parameters to remove in response before comparison like time stamp
ArrayList<String> listOfElementToRemove = new ArrayList<String>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ public class FetchDevice extends BaseTestCase implements ITest {
public void getTestCaseName(Method method, Object[] testdata, ITestContext ctx) throws Exception {
String object = (String) testdata[0];
testCaseName = moduleName + "_" + apiName + "_" + object.toString();
if(!lib.isValidToken(zonalAdminCookie))
zonalAdminCookie = auth.getAuthForZonalAdmin();
if(!lib.isValidToken(adminCookie))
adminCookie = auth.getAuthForAdmin();
}

/**
Expand Down Expand Up @@ -114,9 +114,9 @@ public void fetchDevice(String testcaseName) throws ParseException {
JSONObject objectData = objectDataArray[0];
responseObject = objectDataArray[1];
if (objectData.containsKey("deviceType"))
response = applicationLibrary.getWithPathParam(FetchDevice_id_lang_URI, objectData, zonalAdminCookie);
response = applicationLibrary.getWithPathParam(FetchDevice_id_lang_URI, objectData, adminCookie);
else
response = applicationLibrary.getWithPathParam(FetchDevice_lang_URI, objectData, zonalAdminCookie);
response = applicationLibrary.getWithPathParam(FetchDevice_lang_URI, objectData, adminCookie);
// DB Validation

// This method is for checking the authentication is pass or fail in rest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ public class FetchDeviceSpec extends BaseTestCase implements ITest {
public void getTestCaseName(Method method, Object[] testdata, ITestContext ctx) throws Exception {
String object = (String) testdata[0];
testCaseName = moduleName + "_" + apiName + "_" + object.toString();
if(!lib.isValidToken(zonalApproverCookie))
zonalApproverCookie = auth.getAuthForZonalApprover();
if(!lib.isValidToken(adminCookie))
adminCookie = auth.getAuthForAdmin();
}

/**
Expand Down Expand Up @@ -113,9 +113,9 @@ public void fetchDeviceSpec(String testcaseName) throws ParseException {
JSONObject objectData = objectDataArray[0];
responseObject = objectDataArray[1];
if (objectData.containsKey("devicetypecode"))
response = applicationLibrary.getWithPathParam(FetchDeviceSpec_id_lang_URI, objectData, zonalApproverCookie);
response = applicationLibrary.getWithPathParam(FetchDeviceSpec_id_lang_URI, objectData, adminCookie);
else
response = applicationLibrary.getWithPathParam(FetchDeviceSpec_lang_URI, objectData, zonalApproverCookie);
response = applicationLibrary.getWithPathParam(FetchDeviceSpec_lang_URI, objectData, adminCookie);

// DB Validation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public class FetchDocumentCategories extends BaseTestCase implements ITest {
public void getTestCaseName(Method method, Object[] testdata, ITestContext ctx) throws Exception {
String object = (String) testdata[0];
testCaseName = moduleName+"_"+apiName+"_"+object.toString();
if(!lib.isValidToken(zonalApproverCookie))
zonalApproverCookie=auth.getAuthForZonalApprover();
if(!lib.isValidToken(adminCookie))
adminCookie=auth.getAuthForAdmin();
}

/**
Expand Down Expand Up @@ -116,9 +116,9 @@ public void fetchDocumentCategories(String testcaseName)
responseObject = objectDataArray[1];

if(objectData.containsKey("code"))
response = applicationLibrary.getWithPathParam(FetchDocumentCategories_URI_withcodeAndLangCode,objectData,zonalApproverCookie);
response = applicationLibrary.getWithPathParam(FetchDocumentCategories_URI_withcodeAndLangCode,objectData,adminCookie);
else
response = applicationLibrary.getWithPathParam(FetchDocumentCategories_URI,objectData,zonalApproverCookie);
response = applicationLibrary.getWithPathParam(FetchDocumentCategories_URI,objectData,adminCookie);

//This method is for checking the authentication is pass or fail in rest services
new CommonLibrary().responseAuthValidation(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ public class FetchDocumentTypes extends BaseTestCase implements ITest {
public void getTestCaseName(Method method, Object[] testdata, ITestContext ctx) throws Exception {
String object = (String) testdata[0];
testCaseName = moduleName+"_"+apiName+"_"+object.toString();
if(!lib.isValidToken(zonalApproverCookie))
zonalApproverCookie=auth.getAuthForZonalApprover();
if(!lib.isValidToken(adminCookie))
adminCookie=auth.getAuthForAdmin();

}

Expand Down Expand Up @@ -108,7 +108,7 @@ public void fetchDocumentTypes(String testcaseName)

JSONObject objectData = objectDataArray[0];
responseObject = objectDataArray[1];
response = applicationLibrary.getWithPathParam(FetchDocumentTypes_URI,objectData,zonalApproverCookie);
response = applicationLibrary.getWithPathParam(FetchDocumentTypes_URI,objectData,adminCookie);

// add parameters to remove in response before comparison like time stamp
ArrayList<String> listOfElementToRemove = new ArrayList<String>();
Expand Down
Loading

0 comments on commit e3c6bcf

Please sign in to comment.