Skip to content

Commit

Permalink
MOSIP-35770
Browse files Browse the repository at this point in the history
Signed-off-by: Nandhukumar <[email protected]>
  • Loading branch information
nandhu-kumar committed Sep 18, 2024
1 parent aa6297c commit df5f8ff
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import io.mosip.testrig.apirig.utils.MispPartnerAndLicenseKeyGeneration;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.mosip.testrig.apirig.utils.PartnerRegistration;
import io.mosip.testrig.apirig.utils.SkipTestCaseHandler;

/**
* Class to initiate mosip api test execution
Expand Down Expand Up @@ -71,6 +72,7 @@ public static void main(String[] arg) {
}
ConfigManager.init();
BaseTestCase.suiteSetup();
SkipTestCaseHandler.loadTestcaseToBeSkippedList("testCaseSkippedList.txt");
setLogLevels();

// For now we are not doing health check for qa-115.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import io.mosip.testrig.apirig.utils.AuthenticationTestException;
import io.mosip.testrig.apirig.utils.ConfigManager;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.IdRepoUtil;
import io.mosip.testrig.apirig.utils.KernelAuthentication;
import io.mosip.testrig.apirig.utils.KeycloakUserManager;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
Expand Down Expand Up @@ -89,6 +90,7 @@ public Object[] getTestCaseList(ITestContext context) {
@Test(dataProvider = "testcaselist")
public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, AdminTestException {
testCaseName = testCaseDTO.getTestCaseName();
testCaseName = IdRepoUtil.isTestCaseValidForExecution(testCaseDTO);
if (HealthChecker.signalTerminateExecution) {
throw new SkipException(
GlobalConstants.TARGET_ENV_HEALTH_CHECK_FAILED + HealthChecker.healthCheckFailureMapS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import io.mosip.testrig.apirig.utils.AuthenticationTestException;
import io.mosip.testrig.apirig.utils.ConfigManager;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.IdRepoUtil;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;
Expand Down Expand Up @@ -80,6 +81,7 @@ public Object[] getTestCaseList(ITestContext context) {
@Test(dataProvider = "testcaselist")
public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, AdminTestException {
testCaseName = testCaseDTO.getTestCaseName();
testCaseName = IdRepoUtil.isTestCaseValidForExecution(testCaseDTO);
testCaseName = isTestCaseValidForExecution(testCaseDTO);
if (HealthChecker.signalTerminateExecution) {
throw new SkipException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import io.mosip.testrig.apirig.utils.AuthenticationTestException;
import io.mosip.testrig.apirig.utils.ConfigManager;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.IdRepoUtil;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;
Expand Down Expand Up @@ -82,6 +83,7 @@ public Object[] getTestCaseList(ITestContext context) {
@Test(dataProvider = "testcaselist")
public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, AdminTestException {
testCaseName = testCaseDTO.getTestCaseName();
testCaseName = IdRepoUtil.isTestCaseValidForExecution(testCaseDTO);
testCaseName = isTestCaseValidForExecution(testCaseDTO);
if (HealthChecker.signalTerminateExecution) {
throw new SkipException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import io.mosip.testrig.apirig.utils.AuthenticationTestException;
import io.mosip.testrig.apirig.utils.ConfigManager;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.IdRepoUtil;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;
Expand Down Expand Up @@ -84,6 +85,7 @@ public Object[] getTestCaseList(ITestContext context) {
@Test(dataProvider = "testcaselist")
public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, AdminTestException {
testCaseName = testCaseDTO.getTestCaseName();
testCaseName = IdRepoUtil.isTestCaseValidForExecution(testCaseDTO);
testCaseName = isTestCaseValidForExecution(testCaseDTO);
if (HealthChecker.signalTerminateExecution) {
throw new SkipException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import io.mosip.testrig.apirig.utils.AuthenticationTestException;
import io.mosip.testrig.apirig.utils.ConfigManager;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.IdRepoUtil;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;
Expand Down Expand Up @@ -78,7 +79,7 @@ public Object[] getTestCaseList(ITestContext context) {
@Test(dataProvider = "testcaselist")
public void test(TestCaseDTO testCaseDTO) throws AdminTestException {
testCaseName = testCaseDTO.getTestCaseName();

testCaseName = IdRepoUtil.isTestCaseValidForExecution(testCaseDTO);
if (HealthChecker.signalTerminateExecution) {
throw new SkipException(
GlobalConstants.TARGET_ENV_HEALTH_CHECK_FAILED + HealthChecker.healthCheckFailureMapS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import io.mosip.testrig.apirig.utils.AuthenticationTestException;
import io.mosip.testrig.apirig.utils.ConfigManager;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.IdRepoUtil;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;
Expand Down Expand Up @@ -81,6 +82,7 @@ public Object[] getTestCaseList(ITestContext context) {
@Test(dataProvider = "testcaselist")
public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, AdminTestException {
testCaseName = testCaseDTO.getTestCaseName();
testCaseName = IdRepoUtil.isTestCaseValidForExecution(testCaseDTO);
testCaseName = isTestCaseValidForExecution(testCaseDTO);
String[] templateFields = testCaseDTO.getTemplateFields();
if (HealthChecker.signalTerminateExecution) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import io.mosip.testrig.apirig.utils.AuthenticationTestException;
import io.mosip.testrig.apirig.utils.ConfigManager;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.IdRepoUtil;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;
Expand Down Expand Up @@ -78,6 +79,7 @@ public Object[] getTestCaseList(ITestContext context) {
@Test(dataProvider = "testcaselist")
public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, AdminTestException {
testCaseName = testCaseDTO.getTestCaseName();
testCaseName = IdRepoUtil.isTestCaseValidForExecution(testCaseDTO);
String[] templateFields = testCaseDTO.getTemplateFields();
if (HealthChecker.signalTerminateExecution) {
throw new SkipException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import io.mosip.testrig.apirig.utils.AuthenticationTestException;
import io.mosip.testrig.apirig.utils.ConfigManager;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.IdRepoUtil;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;
Expand Down Expand Up @@ -82,6 +83,7 @@ public Object[] getTestCaseList(ITestContext context) {
@Test(dataProvider = "testcaselist")
public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, AdminTestException {
testCaseName = testCaseDTO.getTestCaseName();
testCaseName = IdRepoUtil.isTestCaseValidForExecution(testCaseDTO);
testCaseName = isTestCaseValidForExecution(testCaseDTO);
auditLogCheck = testCaseDTO.isAuditLogCheck();
String[] templateFields = testCaseDTO.getTemplateFields();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import io.mosip.testrig.apirig.utils.AuthenticationTestException;
import io.mosip.testrig.apirig.utils.ConfigManager;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.IdRepoUtil;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;
Expand Down Expand Up @@ -87,6 +88,7 @@ public Object[] getTestCaseList(ITestContext context) {
public void test(TestCaseDTO testCaseDTO)
throws AuthenticationTestException, AdminTestException, NoSuchAlgorithmException {
testCaseName = testCaseDTO.getTestCaseName();
testCaseName = IdRepoUtil.isTestCaseValidForExecution(testCaseDTO);
if (HealthChecker.signalTerminateExecution) {
throw new SkipException(
GlobalConstants.TARGET_ENV_HEALTH_CHECK_FAILED + HealthChecker.healthCheckFailureMapS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import io.mosip.testrig.apirig.utils.AuthenticationTestException;
import io.mosip.testrig.apirig.utils.ConfigManager;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.IdRepoUtil;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;
Expand Down Expand Up @@ -78,6 +79,7 @@ public Object[] getTestCaseList(ITestContext context) {
@Test(dataProvider = "testcaselist")
public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, AdminTestException {
testCaseName = testCaseDTO.getTestCaseName();
testCaseName = IdRepoUtil.isTestCaseValidForExecution(testCaseDTO);
testCaseDTO.setInputTemplate(AdminTestUtil.generateHbsForUpdateDraft());
if (HealthChecker.signalTerminateExecution) {
throw new SkipException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import io.mosip.testrig.apirig.utils.AuthenticationTestException;
import io.mosip.testrig.apirig.utils.ConfigManager;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.IdRepoUtil;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.mosip.testrig.apirig.utils.PartnerRegistration;
import io.mosip.testrig.apirig.utils.ReportUtil;
Expand Down Expand Up @@ -91,6 +92,7 @@ public Object[] getTestCaseList(ITestContext context) {
@Test(dataProvider = "testcaselist")
public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, AdminTestException {
testCaseName = testCaseDTO.getTestCaseName();
testCaseName = IdRepoUtil.isTestCaseValidForExecution(testCaseDTO);
updateIdentity(testCaseDTO);

}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package io.mosip.testrig.apirig.utils;

import org.apache.log4j.Logger;
import org.testng.SkipException;

import io.mosip.testrig.apirig.dto.TestCaseDTO;

public class IdRepoUtil extends AdminTestUtil {

private static final Logger logger = Logger.getLogger(IdRepoUtil.class);

public static String isTestCaseValidForExecution(TestCaseDTO testCaseDTO) {
String testCaseName = testCaseDTO.getTestCaseName();

if (SkipTestCaseHandler.isTestCaseInSkippedList(testCaseName)) {
throw new SkipException(GlobalConstants.KNOWN_ISSUES);
}
return testCaseName;
}

}
1 change: 1 addition & 0 deletions apitest/src/main/resources/config/Kernel.properties
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ usePreConfiguredOtp=true
eSignetDeployed=yes
partnerUrlSuffix=oYf63Lax0DY2QkYMRHnrmDqhmO3RMWQagwm0ftgLlkuin1KOND/666/576732
reportIgnoredTestCases=no
reportKnownIssueTestCases=no
servicesNotDeployed=
esignetMockBaseURL=esignet-insurance.
sunBirdBaseURL=registry
Expand Down
2 changes: 2 additions & 0 deletions apitest/src/main/resources/testCaseSkippedList.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
##### JIRA number;testcase
#MOSIP-12456------Mimoto_AddIdentity_Binding_smoke_Pos

0 comments on commit df5f8ff

Please sign in to comment.