Skip to content

Commit

Permalink
Merge branch 'mosip:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
likhitharl authored Nov 15, 2024
2 parents e27f09a + 3bfe7bc commit bd1517f
Show file tree
Hide file tree
Showing 53 changed files with 2,168 additions and 699 deletions.
2 changes: 1 addition & 1 deletion apitest/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mosipdev/openjdk-21-jre:latest
FROM mosipid/openjdk-21-jre:21.0.4

ARG SOURCE
ARG COMMIT_HASH
Expand Down
2 changes: 1 addition & 1 deletion apitest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>
io.mosip.testrig.apirig.testrunner.MosipTestRunner</mainClass>
io.mosip.testrig.apirig.injicertify.testrunner.MosipTestRunner</mainClass>
</transformer>
</transformers>
<!-- add this to prevent some security issues when
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.mosip.testrig.apirig.testrunner;
package io.mosip.testrig.apirig.injicertify.testrunner;

import java.io.File;
import java.io.FileInputStream;
Expand All @@ -10,6 +10,7 @@
import java.security.PublicKey;
import java.security.interfaces.RSAPublicKey;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Properties;
Expand All @@ -24,12 +25,16 @@

import io.mosip.testrig.apirig.dataprovider.BiometricDataProvider;
import io.mosip.testrig.apirig.dbaccess.DBManager;
import io.mosip.testrig.apirig.injicertify.utils.InjiCertifyConfigManager;
import io.mosip.testrig.apirig.report.EmailableReport;
import io.mosip.testrig.apirig.testrunner.BaseTestCase;
import io.mosip.testrig.apirig.testrunner.ExtractResource;
import io.mosip.testrig.apirig.testrunner.HealthChecker;
import io.mosip.testrig.apirig.testrunner.OTPListener;
import io.mosip.testrig.apirig.utils.AdminTestUtil;
import io.mosip.testrig.apirig.utils.AuthTestsUtil;
import io.mosip.testrig.apirig.utils.CertsUtil;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.InjiCertifyConfigManager;
import io.mosip.testrig.apirig.utils.JWKKeyUtil;
import io.mosip.testrig.apirig.utils.KeyCloakUserAndAPIKeyGeneration;
import io.mosip.testrig.apirig.utils.KeycloakUserManager;
Expand Down Expand Up @@ -170,25 +175,41 @@ public static void startTestRunner() {
homeDir = new File(dir.getParent() + "/mosip/testNgXmlFiles");
LOGGER.info("ELSE :" + homeDir);
}
for (File file : homeDir.listFiles()) {
TestNG runner = new TestNG();
List<String> suitefiles = new ArrayList<>();
if (file.getName().toLowerCase().contains(GlobalConstants.INJICERTIFY)) {
if (file.getName().toLowerCase().contains("prerequisite")) {
BaseTestCase.setReportName(GlobalConstants.INJICERTIFY + "-prerequisite");
} else {
// if the prerequisite total skipped/failed count is greater than zero
if (EmailableReport.getFailedCount() > 0 || EmailableReport.getSkippedCount() > 0) {
// skipAll = true;
// List and sort the files
File[] files = homeDir.listFiles();
if (files != null) {
Arrays.sort(files, (f1, f2) -> {
// Customize the comparison based on file names
if (f1.getName().toLowerCase().contains("prerequisite")) {
return -1; // f1 should come before f2
} else if (f2.getName().toLowerCase().contains("prerequisite")) {
return 1; // f2 comes before f1
}
return f1.getName().compareTo(f2.getName()); // default alphabetical order
});

for (File file : files) {
TestNG runner = new TestNG();
List<String> suitefiles = new ArrayList<>();
if (file.getName().toLowerCase().contains(GlobalConstants.INJICERTIFY)) {
if (file.getName().toLowerCase().contains("prerequisite")) {
BaseTestCase.setReportName(GlobalConstants.INJICERTIFY + "-prerequisite");
} else {
// if the prerequisite total skipped/failed count is greater than zero
if (EmailableReport.getFailedCount() > 0 || EmailableReport.getSkippedCount() > 0) {
// skipAll = true;
}
BaseTestCase.setReportName(GlobalConstants.INJICERTIFY);
}
BaseTestCase.setReportName(GlobalConstants.INJICERTIFY);
suitefiles.add(file.getAbsolutePath());
runner.setTestSuites(suitefiles);
System.getProperties().setProperty("testng.outpur.dir", "testng-report");
runner.setOutputDirectory("testng-report");
runner.run();
}
suitefiles.add(file.getAbsolutePath());
runner.setTestSuites(suitefiles);
System.getProperties().setProperty("testng.outpur.dir", "testng-report");
runner.setOutputDirectory("testng-report");
runner.run();
}
} else {
LOGGER.error("No files found in directory: " + homeDir);
}

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.mosip.testrig.apirig.testscripts;
package io.mosip.testrig.apirig.injicertify.testscripts;

import java.lang.reflect.Field;
import java.text.DateFormat;
Expand Down Expand Up @@ -26,14 +26,14 @@

import io.mosip.testrig.apirig.dto.OutputValidationDto;
import io.mosip.testrig.apirig.dto.TestCaseDTO;
import io.mosip.testrig.apirig.injicertify.utils.InjiCertifyConfigManager;
import io.mosip.testrig.apirig.injicertify.utils.InjiCertifyUtil;
import io.mosip.testrig.apirig.testrunner.HealthChecker;
import io.mosip.testrig.apirig.testrunner.JsonPrecondtion;
import io.mosip.testrig.apirig.utils.AdminTestException;
import io.mosip.testrig.apirig.utils.AdminTestUtil;
import io.mosip.testrig.apirig.utils.AuthenticationTestException;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.InjiCertifyConfigManager;
import io.mosip.testrig.apirig.utils.InjiCertifyUtil;
import io.mosip.testrig.apirig.utils.KernelAuthentication;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.mosip.testrig.apirig.utils.ReportUtil;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.mosip.testrig.apirig.testscripts;
package io.mosip.testrig.apirig.injicertify.testscripts;

import java.lang.reflect.Field;
import java.util.List;
Expand All @@ -22,14 +22,14 @@

import io.mosip.testrig.apirig.dto.OutputValidationDto;
import io.mosip.testrig.apirig.dto.TestCaseDTO;
import io.mosip.testrig.apirig.injicertify.utils.InjiCertifyConfigManager;
import io.mosip.testrig.apirig.injicertify.utils.InjiCertifyUtil;
import io.mosip.testrig.apirig.testrunner.BaseTestCase;
import io.mosip.testrig.apirig.testrunner.HealthChecker;
import io.mosip.testrig.apirig.utils.AdminTestException;
import io.mosip.testrig.apirig.utils.AdminTestUtil;
import io.mosip.testrig.apirig.utils.AuthenticationTestException;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.InjiCertifyConfigManager;
import io.mosip.testrig.apirig.utils.InjiCertifyUtil;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.mosip.testrig.apirig.testscripts;
package io.mosip.testrig.apirig.injicertify.testscripts;

import java.lang.reflect.Field;
import java.util.HashMap;
Expand All @@ -22,15 +22,15 @@

import io.mosip.testrig.apirig.dto.OutputValidationDto;
import io.mosip.testrig.apirig.dto.TestCaseDTO;
import io.mosip.testrig.apirig.injicertify.utils.InjiCertifyConfigManager;
import io.mosip.testrig.apirig.injicertify.utils.InjiCertifyUtil;
import io.mosip.testrig.apirig.testrunner.BaseTestCase;
import io.mosip.testrig.apirig.testrunner.HealthChecker;
import io.mosip.testrig.apirig.utils.AdminTestException;
import io.mosip.testrig.apirig.utils.AdminTestUtil;
import io.mosip.testrig.apirig.utils.AuthUtil;
import io.mosip.testrig.apirig.utils.AuthenticationTestException;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.InjiCertifyConfigManager;
import io.mosip.testrig.apirig.utils.InjiCertifyUtil;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.mosip.testrig.apirig.utils.PartnerTypes;
import io.mosip.testrig.apirig.utils.ReportUtil;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.mosip.testrig.apirig.testscripts;
package io.mosip.testrig.apirig.injicertify.testscripts;

import java.lang.reflect.Field;
import java.util.ArrayList;
Expand All @@ -23,14 +23,14 @@

import io.mosip.testrig.apirig.dto.OutputValidationDto;
import io.mosip.testrig.apirig.dto.TestCaseDTO;
import io.mosip.testrig.apirig.injicertify.utils.InjiCertifyConfigManager;
import io.mosip.testrig.apirig.injicertify.utils.InjiCertifyUtil;
import io.mosip.testrig.apirig.testrunner.BaseTestCase;
import io.mosip.testrig.apirig.testrunner.HealthChecker;
import io.mosip.testrig.apirig.utils.AdminTestException;
import io.mosip.testrig.apirig.utils.AdminTestUtil;
import io.mosip.testrig.apirig.utils.AuthenticationTestException;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.InjiCertifyConfigManager;
import io.mosip.testrig.apirig.utils.InjiCertifyUtil;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.mosip.testrig.apirig.testscripts;
package io.mosip.testrig.apirig.injicertify.testscripts;

import java.lang.reflect.Field;
import java.util.ArrayList;
Expand All @@ -23,14 +23,14 @@

import io.mosip.testrig.apirig.dto.OutputValidationDto;
import io.mosip.testrig.apirig.dto.TestCaseDTO;
import io.mosip.testrig.apirig.injicertify.utils.InjiCertifyConfigManager;
import io.mosip.testrig.apirig.injicertify.utils.InjiCertifyUtil;
import io.mosip.testrig.apirig.testrunner.BaseTestCase;
import io.mosip.testrig.apirig.testrunner.HealthChecker;
import io.mosip.testrig.apirig.utils.AdminTestException;
import io.mosip.testrig.apirig.utils.AdminTestUtil;
import io.mosip.testrig.apirig.utils.AuthenticationTestException;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.InjiCertifyConfigManager;
import io.mosip.testrig.apirig.utils.InjiCertifyUtil;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.mosip.testrig.apirig.testscripts;
package io.mosip.testrig.apirig.injicertify.testscripts;

import java.lang.reflect.Field;
import java.util.ArrayList;
Expand All @@ -23,14 +23,14 @@

import io.mosip.testrig.apirig.dto.OutputValidationDto;
import io.mosip.testrig.apirig.dto.TestCaseDTO;
import io.mosip.testrig.apirig.injicertify.utils.InjiCertifyConfigManager;
import io.mosip.testrig.apirig.injicertify.utils.InjiCertifyUtil;
import io.mosip.testrig.apirig.testrunner.BaseTestCase;
import io.mosip.testrig.apirig.testrunner.HealthChecker;
import io.mosip.testrig.apirig.utils.AdminTestException;
import io.mosip.testrig.apirig.utils.AdminTestUtil;
import io.mosip.testrig.apirig.utils.AuthenticationTestException;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.InjiCertifyConfigManager;
import io.mosip.testrig.apirig.utils.InjiCertifyUtil;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.mosip.testrig.apirig.testscripts;
package io.mosip.testrig.apirig.injicertify.testscripts;

import java.lang.reflect.Field;
import java.security.NoSuchAlgorithmException;
Expand All @@ -24,14 +24,14 @@

import io.mosip.testrig.apirig.dto.OutputValidationDto;
import io.mosip.testrig.apirig.dto.TestCaseDTO;
import io.mosip.testrig.apirig.injicertify.utils.InjiCertifyConfigManager;
import io.mosip.testrig.apirig.injicertify.utils.InjiCertifyUtil;
import io.mosip.testrig.apirig.testrunner.BaseTestCase;
import io.mosip.testrig.apirig.testrunner.HealthChecker;
import io.mosip.testrig.apirig.utils.AdminTestException;
import io.mosip.testrig.apirig.utils.AdminTestUtil;
import io.mosip.testrig.apirig.utils.AuthenticationTestException;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.InjiCertifyConfigManager;
import io.mosip.testrig.apirig.utils.InjiCertifyUtil;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.mosip.testrig.apirig.testscripts;
package io.mosip.testrig.apirig.injicertify.testscripts;

import java.lang.reflect.Field;
import java.security.NoSuchAlgorithmException;
Expand All @@ -23,14 +23,14 @@

import io.mosip.testrig.apirig.dto.OutputValidationDto;
import io.mosip.testrig.apirig.dto.TestCaseDTO;
import io.mosip.testrig.apirig.injicertify.utils.InjiCertifyConfigManager;
import io.mosip.testrig.apirig.injicertify.utils.InjiCertifyUtil;
import io.mosip.testrig.apirig.testrunner.BaseTestCase;
import io.mosip.testrig.apirig.testrunner.HealthChecker;
import io.mosip.testrig.apirig.utils.AdminTestException;
import io.mosip.testrig.apirig.utils.AdminTestUtil;
import io.mosip.testrig.apirig.utils.AuthenticationTestException;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.InjiCertifyConfigManager;
import io.mosip.testrig.apirig.utils.InjiCertifyUtil;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.mosip.testrig.apirig.utils.ReportUtil;
import io.restassured.response.Response;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package io.mosip.testrig.apirig.utils;
package io.mosip.testrig.apirig.injicertify.utils;

import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import org.apache.log4j.Logger;

import io.mosip.testrig.apirig.testrunner.MosipTestRunner;
import io.mosip.testrig.apirig.injicertify.testrunner.MosipTestRunner;
import io.mosip.testrig.apirig.utils.ConfigManager;

public class InjiCertifyConfigManager extends ConfigManager{
private static final Logger LOGGER = Logger.getLogger(InjiCertifyConfigManager.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.mosip.testrig.apirig.utils;
package io.mosip.testrig.apirig.injicertify.utils;

import org.apache.log4j.Logger;
import org.json.JSONObject;
Expand All @@ -7,8 +7,12 @@
import com.nimbusds.jose.jwk.RSAKey;

import io.mosip.testrig.apirig.dto.TestCaseDTO;
import io.mosip.testrig.apirig.testrunner.MosipTestRunner;
import io.mosip.testrig.apirig.injicertify.testrunner.MosipTestRunner;
import io.mosip.testrig.apirig.testrunner.OTPListener;
import io.mosip.testrig.apirig.utils.AdminTestUtil;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.JWKKeyUtil;
import io.mosip.testrig.apirig.utils.SkipTestCaseHandler;

public class InjiCertifyUtil extends AdminTestUtil {

Expand Down
2 changes: 1 addition & 1 deletion apitest/testNgXmlFiles/injicertifyPrerequisiteSuite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parameter name="ymlFile" value="injicertify/AddIdentity/AddIdentity.yml" />
<parameter name="prerequisite" value="Yes" />
<classes>
<class name="io.mosip.testrig.apirig.testscripts.AddIdentity" />
<class name="io.mosip.testrig.apirig.injicertify.testscripts.AddIdentity" />
</classes>
</test>
</suite>
Loading

0 comments on commit bd1517f

Please sign in to comment.