Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…tion-tests into develop
  • Loading branch information
Jayesh Kharode committed Dec 1, 2023
2 parents 6bbde14 + ec9f66a commit 47f8f0a
Show file tree
Hide file tree
Showing 20 changed files with 310 additions and 72 deletions.
4 changes: 2 additions & 2 deletions mosip-acceptance-tests/ivv-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<parent>
<groupId>io.mosip.testrig.dslrig.ivv</groupId>
<artifactId>dslrig-ivv-parent</artifactId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1-develop-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<groupId>io.mosip.testrig.dslrig.ivv.core</groupId>
<artifactId>dslrig-ivv-core</artifactId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1-develop-SNAPSHOT</version>
<properties>
<maven.sonar.plugin.version>3.7.0.1746</maven.sonar.plugin.version>
</properties>
Expand Down
8 changes: 4 additions & 4 deletions mosip-acceptance-tests/ivv-dg/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<parent>
<groupId>io.mosip.testrig.dslrig.ivv</groupId>
<artifactId>dslrig-ivv-parent</artifactId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1-develop-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1-develop-SNAPSHOT</version>
<groupId>io.mosip.testrig.dslrig.ivv.dg</groupId>
<artifactId>dslrig-ivv-dg</artifactId>
<properties>
Expand All @@ -18,12 +18,12 @@
<dependency>
<groupId>io.mosip.testrig.dslrig.ivv.core</groupId>
<artifactId>dslrig-ivv-core</artifactId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1-develop-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.mosip.testrig.dslrig.ivv.parser</groupId>
<artifactId>dslrig-ivv-parser</artifactId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1-develop-SNAPSHOT</version>
</dependency>
</dependencies>

Expand Down
30 changes: 19 additions & 11 deletions mosip-acceptance-tests/ivv-orchestrator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<parent>
<groupId>io.mosip.testrig.dslrig.ivv</groupId>
<artifactId>dslrig-ivv-parent</artifactId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1-develop-SNAPSHOT</version>

</parent>

<groupId>io.mosip.testrig.dslrig.ivv.orchestrator</groupId>
<artifactId>dslrig-ivv-orchestrator</artifactId>
<name>mosip-dsl-test</name>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1-develop-SNAPSHOT</version>
<properties>
<suiteXmlFile>testng.xml</suiteXmlFile>
<maven.sonar.plugin.version>3.7.0.1746</maven.sonar.plugin.version>
Expand Down Expand Up @@ -49,10 +49,6 @@
</configuration>
</plugin>





<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand All @@ -63,7 +59,7 @@
<goal>shade</goal>
</goals>
<configuration>
<finalName>dslrig-ivv-orchestrator-1.2.1-SNAPSHOT-jar-with-dependencies</finalName>
<finalName>dslrig-ivv-orchestrator-1.2.1-develop-SNAPSHOT-jar-with-dependencies</finalName>
<transformers>
<!-- need this to merge the services files properly -->
<transformer
Expand Down Expand Up @@ -105,12 +101,12 @@
<dependency>
<groupId>io.mosip.testrig.dslrig.ivv.core</groupId>
<artifactId>dslrig-ivv-core</artifactId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1-develop-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.mosip.testrig.dslrig.ivv.dg</groupId>
<artifactId>dslrig-ivv-dg</artifactId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1-develop-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.aventstack</groupId>
Expand All @@ -121,7 +117,7 @@
<dependency>
<groupId>io.mosip.testrig.apirig.automationtests</groupId>
<artifactId>automationtests</artifactId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1-develop-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>com.sun.jersey</groupId>
Expand All @@ -139,14 +135,26 @@
<dependency>
<groupId>io.mosip.kernel</groupId>
<artifactId>kernel-biometrics-api</artifactId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.0.1-B1</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.5</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.cache/cache-api -->
<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
<version>1.0.0</version>
</dependency>

<dependency>
<groupId>org.ehcache</groupId>
<artifactId>jcache</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import io.mosip.testrig.dslrig.ivv.core.base.StepInterface;
import io.mosip.testrig.dslrig.ivv.core.exceptions.RigInternalError;
import io.mosip.testrig.dslrig.ivv.orchestrator.BaseTestCaseUtil;
import io.mosip.testrig.dslrig.ivv.orchestrator.PersonaDataManager;
import io.restassured.response.Response;

public class GenerateVID extends BaseTestCaseUtil implements StepInterface {
Expand All @@ -45,21 +46,24 @@ public void run() throws RigInternalError {
String uins = null;
String vidtype = null;
List<String> uinList = null;
String emailId ="";
//String transactionID = (step.getScenario().getId() + RandomStringUtils.randomNumeric(8)).substring(0, 10);
String transactionID=(step.getScenario().getId() + RandomStringUtils.randomNumeric(11));
transactionID=transactionID.substring(0, 10);
logger.info(transactionID);
String emailId = "";
String vid = "";
// String transactionID = (step.getScenario().getId() +
// RandomStringUtils.randomNumeric(8)).substring(0, 10);
String transactionID = (step.getScenario().getId() + RandomStringUtils.randomNumeric(11));
transactionID = transactionID.substring(0, 10);
logger.info(transactionID);

if (step.getParameters() == null || step.getParameters().isEmpty() || step.getParameters().size() < 1) {
logger.error("VID Type[Perpetual/Temporary] parameter is missing from DSL step");
this.hasError=true;throw new RigInternalError("VID Type[Perpetual/Temporary] paramter is missing in step: " + step.getName());
this.hasError = true;
throw new RigInternalError("VID Type[Perpetual/Temporary] paramter is missing in step: " + step.getName());
} else {
vidtype = step.getParameters().get(0);

}
if (step.getParameters().size() == 3 && step.getParameters().get(1).startsWith("$$")) {
uins = step.getParameters().get(1); // "$$vid=e2e_GenerateVID(Perpetual,$$uin,$$email)"
if (step.getParameters().size() == 3 && step.getParameters().get(1).startsWith("$$")) {
uins = step.getParameters().get(1); // "$$vid=e2e_GenerateVID(Perpetual,$$uin,$$email)"
if (uins.startsWith("$$")) {
uins = step.getScenario().getVariables().get(uins);
uinList = new ArrayList<>(Arrays.asList(uins.split("@@")));
Expand All @@ -71,28 +75,25 @@ public void run() throws RigInternalError {
} else
uinList = new ArrayList<>(step.getScenario().getUinPersonaProp().stringPropertyNames());

if (step.getParameters().size() == 3 && step.getParameters().get(2).startsWith("$$")) {
emailId = step.getParameters().get(2); // "$$vid=e2e_GenerateVID(Perpetual,$$uin,$$email)"
if (step.getParameters().size() == 3 && step.getParameters().get(2).startsWith("$$")) {
emailId = step.getParameters().get(2); // "$$vid=e2e_GenerateVID(Perpetual,$$uin,$$email)"
if (emailId.startsWith("$$")) {
emailId = step.getScenario().getVariables().get(emailId);
}
}

if(emailId!=null && !emailId.isEmpty()) {
if (emailId != null && !emailId.isEmpty()) {
Object[] testObj = generatevid.getYmlTestData(GenerateVIDYml);

TestCaseDTO test = (TestCaseDTO) testObj[0];


for (String uin : uinList) {
String input = test.getInput();
input = JsonPrecondtion.parseAndReturnJsonContent(input, uin, "individualId");
input = JsonPrecondtion.parseAndReturnJsonContent(input, vidtype, "vidType");


input = JsonPrecondtion.parseAndReturnJsonContent(input, emailId, "otp");


input = JsonPrecondtion.parseAndReturnJsonContent(input, uin, "sendOtp.individualId");
input = JsonPrecondtion.parseAndReturnJsonContent(input, transactionID, "sendOtp.transactionID");
input = JsonPrecondtion.parseAndReturnJsonContent(input, transactionID, "transactionID");
Expand All @@ -104,7 +105,7 @@ public void run() throws RigInternalError {
Response response = generatevid.response;
if (response != null) {
JSONObject jsonResp = new JSONObject(response.getBody().asString());
String vid = jsonResp.getJSONObject("response").getString("vid");
vid = jsonResp.getJSONObject("response").getString("vid");
if (step.getOutVarName() != null)
step.getScenario().getVariables().put(step.getOutVarName(), vid);
else
Expand All @@ -114,18 +115,16 @@ public void run() throws RigInternalError {
}

} catch (AuthenticationTestException | AdminTestException e) {
this.hasError=true;throw new RigInternalError(e.getMessage());
this.hasError = true;
throw new RigInternalError(e.getMessage());

}
}
}
else
{
} else {
Object[] testObj = generatevidwithoutotp.getYmlTestData(GenerateVID);

TestCaseDTO test = (TestCaseDTO) testObj[0];


for (String uin : uinList) {
String input = test.getInput();
input = JsonPrecondtion.parseAndReturnJsonContent(input, uin, "UIN");
Expand All @@ -139,7 +138,7 @@ public void run() throws RigInternalError {
Response response = generatevidwithoutotp.response;
if (response != null) {
JSONObject jsonResp = new JSONObject(response.getBody().asString());
String vid = jsonResp.getJSONObject("response").getString("VID");
vid = jsonResp.getJSONObject("response").getString("VID");
if (step.getOutVarName() != null)
step.getScenario().getVariables().put(step.getOutVarName(), vid);
else
Expand All @@ -149,10 +148,12 @@ public void run() throws RigInternalError {
}

} catch (AuthenticationTestException | AdminTestException e) {
this.hasError=true;throw new RigInternalError(e.getMessage());
this.hasError = true;
throw new RigInternalError(e.getMessage());

}
}
}
PersonaDataManager.setVariableValue(step.getScenario().getId(), "VID", vid);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import io.mosip.testrig.dslrig.ivv.core.base.StepInterface;
import io.mosip.testrig.dslrig.ivv.core.exceptions.RigInternalError;
import io.mosip.testrig.dslrig.ivv.orchestrator.BaseTestCaseUtil;
import io.mosip.testrig.dslrig.ivv.orchestrator.PersonaDataManager;
import io.restassured.response.Response;

public class GetUINByRid extends BaseTestCaseUtil implements StepInterface {
Expand All @@ -22,7 +23,7 @@ public class GetUINByRid extends BaseTestCaseUtil implements StepInterface {
static Logger logger = Logger.getLogger(GetUINByRid.class);
KernelAuthentication kauth = new KernelAuthentication();
Boolean isForChildPacket = false;

static {
if (ConfigManager.IsDebugEnabled())
logger.setLevel(Level.ALL);
Expand Down Expand Up @@ -56,8 +57,6 @@ public void getIdentity(HashMap<String, String> rids) throws RigInternalError {
step.getScenario().getUinPersonaProp().clear();
for (String rid : rids.values()) {
if (rid != null) {
// Reporter.log("<b><u>" + "GetIdentity By Rid" + "</u></b>");
// Reporter.log("<pre>" + ReportUtil.getTextAreaJsonMsgHtml("{Rid: " + rid + "}") + "</pre>");
long startTime = System.currentTimeMillis();
logger.info(this.getClass().getSimpleName() + " starts at..." + startTime + " MilliSec");
Response response = getRequest(baseUrl + getIdentityUrl + rid, "Get uin by rid: " + rid, step);
Expand All @@ -83,7 +82,8 @@ else if (!StringUtils.isEmpty(uin) && !(uin.trim().contains("errorCode"))) {
logger.error("Issue while fetching identity for RID: " + rid + " Response: " + response.toString());
this.hasError = true;
throw new RigInternalError("Not able to Fetch identity for RID: " + rid);
}
}
PersonaDataManager.setVariableValue(step.getScenario().getId(), "UIN", uin);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import io.mosip.testrig.dslrig.ivv.core.exceptions.RigInternalError;
import io.mosip.testrig.dslrig.ivv.orchestrator.BaseTestCaseUtil;
import io.mosip.testrig.dslrig.ivv.orchestrator.PacketUtility;
import io.mosip.testrig.dslrig.ivv.orchestrator.PersonaDataManager;

public class SetContext extends BaseTestCaseUtil implements StepInterface {
static Logger logger = Logger.getLogger(SetContext.class);
Expand Down Expand Up @@ -93,13 +94,14 @@ else if (value.startsWith("$$")) {
invalidCheckSum = step.getParameters().get(8);

}

PersonaDataManager.setVariableValue(step.getScenario().getId(), "PersonaID", step.getScenario().getId());
if (userAndMachineDetailParam != null)
packetUtility.createContexts(contextKeyValue, userAndMachineDetailParam, mosipVersion, generatePrivateKey,
status, BaseTestCase.ApplnURI + "/", step);
else if (map != null)
packetUtility.createContexts(negative, contextKeyValue, map, mosipVersion, generatePrivateKey, status,
BaseTestCase.ApplnURI + "/", step, invalidCertFlag, consent, changeSupervisorNameToDiffCase,
invalidEncryptedHashFlag, invalidCheckSum);

}
}
Loading

0 comments on commit 47f8f0a

Please sign in to comment.