Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
package io.mosip.testrig.apirig.esignet.testscripts;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.testng.ITest;
import org.testng.ITestContext;
import org.testng.ITestResult;
import org.testng.SkipException;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import io.mosip.testrig.apirig.dbaccess.DBManager;
import io.mosip.testrig.apirig.dto.OutputValidationDto;
import io.mosip.testrig.apirig.dto.TestCaseDTO;
import io.mosip.testrig.apirig.esignet.utils.EsignetConfigManager;
import io.mosip.testrig.apirig.esignet.utils.EsignetUtil;
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.AuthenticationTestException;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.mosip.testrig.apirig.utils.SecurityXSSException;
import io.restassured.response.Response;

public class AuditValidator extends EsignetUtil implements ITest {
private static final Logger logger = Logger.getLogger(AuditValidator.class);
protected String testCaseName = "";
public static List<String> templateFields = new ArrayList<>();
public Response response = null;

/**
* get current testcaseName
*/
@Override
public String getTestName() {
return testCaseName;
}

@BeforeClass
public static void setLogLevel() {
if (EsignetConfigManager.IsDebugEnabled())
logger.setLevel(Level.ALL);
else
logger.setLevel(Level.ERROR);
}

/**
* Data provider class provides test case list
*
* @return object of data provider
*/
@DataProvider(name = "testcaselist")
public Object[] getTestCaseList(ITestContext context) {
String ymlFile = context.getCurrentXmlTest().getLocalParameters().get("ymlFile");
logger.info("Started executing yml: " + ymlFile);
return getYmlTestData(ymlFile);
}

@Test(dataProvider = "testcaselist")
public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, AdminTestException, SecurityXSSException {
testCaseName = testCaseDTO.getTestCaseName();
testCaseName = EsignetUtil.isTestCaseValidForExecution(testCaseDTO);
if (HealthChecker.signalTerminateExecution) {
throw new SkipException(
GlobalConstants.TARGET_ENV_HEALTH_CHECK_FAILED + HealthChecker.healthCheckFailureMapS);
}
String[] templateFields = testCaseDTO.getTemplateFields();
List<String> queryProp = Arrays.asList(templateFields);
logger.info(queryProp);
String query = "select * from audit.app_audit_log where cr_by = '" + BaseTestCase.currentModule + "-"
+ EsignetConfigManager.getproperty("partner_userName") + "'";

logger.info(query);
Map<String, Object> response = DBManager.executeQueryAndGetRecord(testCaseDTO.getRole(), query);

Map<String, List<OutputValidationDto>> objMap = new HashMap<>();
List<OutputValidationDto> objList = new ArrayList<>();
OutputValidationDto objOpDto = new OutputValidationDto();
if (response.size() > 0) {

objOpDto.setStatus("PASS");
} else {
objOpDto.setStatus(GlobalConstants.FAIL_STRING);
}

objList.add(objOpDto);
objMap.put(GlobalConstants.EXPECTED_VS_ACTUAL, objList);

if (!OutputValidationUtil.publishOutputResult(objMap))
throw new AdminTestException("Failed at output validation");
}

/**
* The method ser current test name to result
*
* @param result
*/
@AfterMethod(alwaysRun = true)
public void setResultTestName(ITestResult result) {

String deleteQuery = "delete from audit.app_audit_log where cr_by = '"
+ EsignetConfigManager.getproperty("partner_userName") + "'";
logger.info(deleteQuery);
DBManager.executeQueryAndDeleteRecord("audit", deleteQuery);

result.setAttribute("TestCaseName", testCaseName);
}
Comment thread
SradhaMohanty5899 marked this conversation as resolved.
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
package io.mosip.testrig.apirig.esignet.testscripts;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.json.JSONObject;
import org.testng.ITest;
import org.testng.ITestContext;
import org.testng.ITestResult;
import org.testng.SkipException;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import io.mosip.testrig.apirig.dbaccess.DBManager;
import io.mosip.testrig.apirig.dto.OutputValidationDto;
import io.mosip.testrig.apirig.dto.TestCaseDTO;
import io.mosip.testrig.apirig.esignet.utils.EsignetConfigManager;
import io.mosip.testrig.apirig.esignet.utils.EsignetUtil;
import io.mosip.testrig.apirig.testrunner.HealthChecker;
import io.mosip.testrig.apirig.utils.AdminTestException;
import io.mosip.testrig.apirig.utils.AuthenticationTestException;
import io.mosip.testrig.apirig.utils.GlobalConstants;
import io.mosip.testrig.apirig.utils.OutputValidationUtil;
import io.mosip.testrig.apirig.utils.SecurityXSSException;
import io.restassured.response.Response;

public class DBValidator extends EsignetUtil implements ITest {
private static final Logger logger = Logger.getLogger(DBValidator.class);
protected String testCaseName = "";
public static List<String> templateFields = new ArrayList<>();
public Response response = null;

@BeforeClass
public static void setLogLevel() {
if (EsignetConfigManager.IsDebugEnabled())
logger.setLevel(Level.ALL);
else
logger.setLevel(Level.ERROR);
}

/**
* get current testcaseName
*/
@Override
public String getTestName() {
return testCaseName;
}

/**
* Data provider class provides test case list
*
* @return object of data provider
*/
@DataProvider(name = "testcaselist")
public Object[] getTestCaseList(ITestContext context) {
String ymlFile = context.getCurrentXmlTest().getLocalParameters().get("ymlFile");
logger.info("Started executing yml: " + ymlFile);
return getYmlTestData(ymlFile);
}

@Test(dataProvider = "testcaselist")
public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, AdminTestException, SecurityXSSException {
testCaseName = testCaseDTO.getTestCaseName();
testCaseName = EsignetUtil.isTestCaseValidForExecution(testCaseDTO);
if (HealthChecker.signalTerminateExecution) {
throw new SkipException(
GlobalConstants.TARGET_ENV_HEALTH_CHECK_FAILED + HealthChecker.healthCheckFailureMapS);
}

String inputJson = getJsonFromTemplate(testCaseDTO.getInput(), testCaseDTO.getInputTemplate());
String replaceId = inputJsonKeyWordHandeler(inputJson, testCaseName);

JSONObject jsonObject = new JSONObject(replaceId);
logger.info(jsonObject.keySet());
Set<String> set = new TreeSet<>();
set.addAll(jsonObject.keySet());
String filterId = "";

if (set.stream().findFirst().isPresent())
filterId = set.stream().findFirst().get();

logger.info(filterId);
String query = testCaseDTO.getEndPoint() + " " + filterId + " = " + "'" + jsonObject.getString(filterId) + "'";
Comment on lines +83 to +91
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Handle case where JSON input has no keys.

If jsonObject.keySet() is empty, filterId remains an empty string, and the query on line 91 becomes malformed (e.g., "SELECT * FROM pms.oidc_client where = 'null'"). Consider adding validation or throwing a meaningful exception.

🛡️ Proposed fix to validate JSON keys
 		Set<String> set = new TreeSet<>();
 		set.addAll(jsonObject.keySet());
 		String filterId = "";
 
-		if (set.stream().findFirst().isPresent())
+		if (set.stream().findFirst().isPresent()) {
 			filterId = set.stream().findFirst().get();
+		} else {
+			throw new AdminTestException("Input JSON must contain at least one key for DB query filter");
+		}
 
 		logger.info(filterId);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/DBValidator.java`
around lines 83 - 91, DBValidator builds a query using filterId derived from
jsonObject.keySet() but does not handle the empty-key case, producing malformed
queries; update the code in DBValidator to validate jsonObject.keySet() before
using filterId: if jsonObject.keySet() is empty, either throw a clear
IllegalArgumentException (or return/fail the test) with a descriptive message,
and log the condition via logger (e.g., include jsonObject in the log),
otherwise safely extract the first key (filterId) and build the query using
testCaseDTO.getEndPoint() and jsonObject.getString(filterId); ensure no attempt
to call jsonObject.getString("") occurs and that downstream code expects the
exception/return.


logger.info(query);
Map<String, Object> response = DBManager.executeQueryAndGetRecord(testCaseDTO.getRole(), query);

Map<String, List<OutputValidationDto>> objMap = new HashMap<>();
List<OutputValidationDto> objList = new ArrayList<>();
OutputValidationDto objOpDto = new OutputValidationDto();
if (response.size() > 0) {

objOpDto.setStatus("PASS");
} else {
objOpDto.setStatus(GlobalConstants.FAIL_STRING);
}

objList.add(objOpDto);
objMap.put(GlobalConstants.EXPECTED_VS_ACTUAL, objList);

if (!OutputValidationUtil.publishOutputResult(objMap))
throw new AdminTestException("Failed at output validation");
}

/**
* The method ser current test name to result
*
* @param result
*/
@AfterMethod(alwaysRun = true)
public void setResultTestName(ITestResult result) {
result.setAttribute("TestCaseName", testCaseName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
public class PostWithBodyAndPathParams extends EsignetUtil implements ITest {
private static final Logger logger = Logger.getLogger(PostWithBodyAndPathParams.class);
protected String testCaseName = "";
public String idKeyName = null;
String pathParams = null;
String headers = null;
public Response response = null;
Expand Down Expand Up @@ -64,6 +65,7 @@ public String getTestName() {
public Object[] getTestCaseList(ITestContext context) {
String ymlFile = context.getCurrentXmlTest().getLocalParameters().get("ymlFile");
pathParams = context.getCurrentXmlTest().getLocalParameters().get("pathParams");
idKeyName = context.getCurrentXmlTest().getLocalParameters().get("idKeyName");
headers = context.getCurrentXmlTest().getLocalParameters().get("headers");
logger.info("Started executing yml: " + ymlFile);
return getYmlTestData(ymlFile);
Expand Down Expand Up @@ -135,6 +137,10 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad
if (!OutputValidationUtil.publishOutputResult(ouputValid))
throw new AdminTestException("Failed at output validation");
}

if (testCaseName.toLowerCase().contains("_sid")) {
writeAutoGeneratedId(response, idKeyName, testCaseName);
}

}

Expand Down
16 changes: 16 additions & 0 deletions api-test/src/main/resources/esignet/AuditLog/AuditLog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
addContact:
Esignet_AddContact_All_Valid_Smoke:
endPoint: SELECT module_name,cr_by FROM audit.app_audit_log where module_name LIKE 'esignet%' order by action_dtimes desc LIMIT 5
uniqueIdentifier: TC_Esignet_addContact_01
description: Validate that a contact is successfully added when all input parameters are valid
role: audit
templateFields: ["partnerQuery","partner service"]
restMethod: post
inputTemplate: esignet/AuditLog/auditlog
outputTemplate: esignet/AuditLog/AuditLogResult
input: '{
}'
output: '{
"module_name": "esignet-service"
"cr_by": "111997"
}'
Comment on lines +13 to +16
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix invalid JSON in expected output.

Line 14 and Line 15 are missing a comma, so this expected payload is not valid JSON.

💡 Suggested fix
     output: '{
-      "module_name": "esignet-service"
+      "module_name": "esignet-service",
       "cr_by": "111997"
    }'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@api-test/src/main/resources/esignet/AuditLog/AuditLog.yml` around lines 13 -
16, The expected JSON in the AuditLog.yml "output" value is invalid because the
properties are missing a comma; update the "output" string in AuditLog.yml (the
output mapping for the AuditLog fixture) to be valid JSON by inserting the
missing comma between "module_name" and "cr_by" and ensure proper
quoting/escaping so the entire value remains a single valid JSON string; after
editing, validate the JSON syntax to confirm the payload is well-formed.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"module_name": "{{module_name}}",
"cr_by": "{{cr_by}}"
}
2 changes: 2 additions & 0 deletions api-test/src/main/resources/esignet/AuditLog/auditlog.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
{{#each this}}
"{{@key}}": "{{this}}"
{{#unless @last}},{{/unless}}
{{/each}}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
DBValidator:
Esignet_DBValidator_All_Valid_Smoke_data_created_for_OIDCClient:
endPoint: SELECT * FROM pms.oidc_client where
uniqueIdentifier: TC_Esignet_DBValidator_01
description: Validate that data created for OIDCClient is correctly stored and consistent in the pms database
role: partner
restMethod: post
inputTemplate: esignet/DBValidatorAndAuditValidator/DBValidatorTest
outputTemplate: esignet/DBValidatorAndAuditValidator/DBValidatorTestResult
input: '{
"id": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$"
}'
output: '{
}'

Esignet_DBValidator_All_Valid_Smoke_data_created_for_OIDCClient_Client_detail:
endPoint: SELECT * FROM esignet.client_detail where
uniqueIdentifier: TC_Esignet_DBValidator_02
description: Validate that data created for OIDCClient client details is correctly stored and consistent in the esignet database
role: partner
restMethod: post
inputTemplate: esignet/DBValidatorAndAuditValidator/DBValidatorTest
outputTemplate: esignet/DBValidatorAndAuditValidator/DBValidatorTestResult
input: '{
"id": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$"
}'
output: '{
}'

Esignet_DBValidator_All_Valid_Smoke_data_created_for_OIDCClient_Using_IDA:
endPoint: SELECT * FROM ida.oidc_client_data where
uniqueIdentifier: TC_Esignet_DBValidator_03
description: Validate that data created for OIDCClient client details is correctly stored and consistent in the ida database
role: partner
restMethod: post
inputTemplate: esignet/DBValidatorAndAuditValidator/DBValidatorTest
outputTemplate: esignet/DBValidatorAndAuditValidator/DBValidatorTestResult
input: '{
"oidc_client_id": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$"
}'
output: '{
}'
Comment on lines +2 to +42
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== DBValidator consumer tests ==="
rg -n "TC_Esignet_DBValidator_0[1-3]|CreateOIDCClient_all_Valid_Smoke_sid_clientId|additionalDependencies" \
  api-test/src/main/resources/esignet/DBValidatorAndAuditValidator/DBValidatorTest.yml

echo "=== Locate producer testcase + uniqueIdentifier ==="
rg -n "CreateOIDCClient_all_Valid_Smoke_sid|uniqueIdentifier" \
  api-test/src/main/resources/esignet -g '*.yml'

echo "=== Centralized dependency maps ==="
fd "testCaseInterDependency_.*\\.json" api-test/src/main/resources/config \
  -x sh -c 'echo "--- {} ---"; rg -n "TC_Esignet_DBValidator_0[1-3]|CreateOIDCClient_all_Valid_Smoke_sid" "{}"'

Repository: mosip/esignet

Length of output: 50370


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Search for producer test: CreateOIDCClient + all_Valid_Smoke ==="
rg -l "CreateOIDCClient" api-test/src/main/resources/esignet -g '*.yml' | head -5

echo "=== Check specific OIDC client creation test file ==="
fd "PatchOIDCClient\|CreateOIDCClient" api-test/src/main/resources/esignet -type f -name "*.yml"

echo "=== Search in root esignet test directory for CreateOIDCClient ==="
rg "uniqueIdentifier.*CreateOIDCClient|CreateOIDCClient.*uniqueIdentifier" \
  api-test/src/main/resources/esignet -A 1 -B 1 | head -30

echo "=== Check centralized dependency JSON files for DBValidator ==="
find api-test/src/main/resources/config -name "testCaseInterDependency*.json" -exec sh -c '
  echo "=== {} ==="
  jq . "{}" 2>/dev/null | grep -A 5 -B 5 "DBValidator\|CreateOIDCClient" || echo "No match"
' \;

Repository: mosip/esignet

Length of output: 794


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Find OIDC client creation test files ==="
fd "CreateOIDCClient\|PatchOIDCClient" api-test/src/main/resources/esignet

echo "=== Search for all_Valid_Smoke test case definition ==="
rg "all_Valid_Smoke" api-test/src/main/resources/esignet -l -g '*.yml'

echo "=== Search for uniqueIdentifier containing CreateOIDCClient ==="
rg "uniqueIdentifier:.*CreateOIDCClient|uniqueIdentifier:.*Smoke" \
  api-test/src/main/resources/esignet -g '*.yml' | head -20

echo "=== List centralized config files ==="
ls -la api-test/src/main/resources/config/testCaseInterDependency*

echo "=== Check testCaseInterDependency files for DBValidator or Smoke ==="
for file in api-test/src/main/resources/config/testCaseInterDependency*.json; do
  if [ -f "$file" ]; then
    echo "=== File: $file ==="
    rg "DBValidator|Smoke|CreateOIDCClient" "$file" -c
  fi
done

Repository: mosip/esignet

Length of output: 13554


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Check testCaseInterDependency_mock.json for DBValidator entries ==="
jq '.[] | select(.testcaseId | contains("DBValidator")) | {testcaseId, dependencies}' \
  api-test/src/main/resources/config/testCaseInterDependency_mock.json | head -60

echo "=== Search for producer test that outputs CreateOIDCClient_all_Valid_Smoke_sid_clientId ==="
rg "outputIdentifier|all_Valid_Smoke_sid" api-test/src/main/resources/esignet -A 2 -B 2 -g '*.yml' | head -40

echo "=== Check mock dependency file for entries related to CreateOIDCClient_all_Valid_Smoke ==="
jq '.[] | select(.outputIdentifier | contains("all_Valid_Smoke")) | {testcaseId, outputIdentifier}' \
  api-test/src/main/resources/config/testCaseInterDependency_mock.json

Repository: mosip/esignet

Length of output: 279


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Check JSON structure ==="
jq '.[0]' api-test/src/main/resources/config/testCaseInterDependency_mock.json

echo "=== Search for DBValidator entries in array ==="
jq '.[] | select(.testcaseId and (.testcaseId | contains("DBValidator"))) | {testcaseId: .testcaseId, dependencies: .dependencies}' \
  api-test/src/main/resources/config/testCaseInterDependency_mock.json

echo "=== Search for entries with all_Valid_Smoke in output ==="
jq '.[] | select(.outputIdentifier and (.outputIdentifier | contains("all_Valid_Smoke"))) | {testcaseId: .testcaseId, outputIdentifier: .outputIdentifier}' \
  api-test/src/main/resources/config/testCaseInterDependency_mock.json

Repository: mosip/esignet

Length of output: 224


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Check file structure ==="
head -5 api-test/src/main/resources/config/testCaseInterDependency_mock.json
tail -5 api-test/src/main/resources/config/testCaseInterDependency_mock.json

echo "=== Search for DBValidator in dependency files with grep ==="
grep -n "DBValidator\|CreateOIDCClient_all_Valid_Smoke" \
  api-test/src/main/resources/config/testCaseInterDependency_mock.json | head -20

echo "=== Check if CreateOIDCClient_all_Valid_Smoke_sid exists anywhere in YAML ==="
rg -l "CreateOIDCClient_all_Valid_Smoke_sid[^_]" api-test/src/main/resources/esignet -g '*.yml' | head -10

echo "=== Find what outputs the ID CreateOIDCClient_all_Valid_Smoke_sid_clientId ==="
rg "outputIdentifier.*CreateOIDCClient_all_Valid_Smoke_sid|all_Valid_Smoke.*outputIdentifier" \
  api-test/src/main/resources/esignet -g '*.yml'

Repository: mosip/esignet

Length of output: 597


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Search ALL dependency files for DBValidator ==="
for file in api-test/src/main/resources/config/testCaseInterDependency*.json; do
  echo "File: $file"
  grep -c "DBValidator" "$file" || echo "Not found"
done

echo "=== Search ALL dependency files for CreateOIDCClient entries ==="
grep "CreateOIDCClient" api-test/src/main/resources/config/testCaseInterDependency_mock.json | head -10

echo "=== Find test case with all_Valid_Smoke in name or output ==="
rg "all_Valid_Smoke" api-test/src/main/resources/esignet -g '*.yml' -B 5 -A 1 | grep -E "(uniqueIdentifier|outputIdentifier|all_Valid_Smoke)" | head -30

echo "=== Check CreateOIDCClientV2 or V3 files for smoke tests ==="
fd "CreateOIDCClient" api-test/src/main/resources/esignet -type d

echo "=== Look at OidcClient.yml which appeared in earlier results ==="
rg "all_Valid_Smoke|outputIdentifier|CreateOIDCClient_all_Valid_Smoke" \
  api-test/src/main/resources/esignet/OidcClient/OIDCClient.yml -A 2 -B 2

Repository: mosip/esignet

Length of output: 6078


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Search for producer test outputIdentifier for all_Valid_Smoke_sid ==="
rg "outputIdentifier.*all_Valid_Smoke_sid|all_Valid_Smoke.*outputIdentifier" \
  api-test/src/main/resources/esignet -g '*.yml' -A 1 -B 2

echo "=== Check DBValidatorTest.yml for additionalDependencies ==="
cat api-test/src/main/resources/esignet/DBValidatorAndAuditValidator/DBValidatorTest.yml | head -50

echo "=== Search in entire codebase for CreateOIDCClient_all_Valid_Smoke_sid as outputIdentifier ==="
rg "CreateOIDCClient_all_Valid_Smoke_sid" api-test/src/main/resources/esignet -g '*.yml' -B 10 | grep -E "(uniqueIdentifier|outputIdentifier|test.*:$)" | head -20

Repository: mosip/esignet

Length of output: 130


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Full content of DBValidatorTest.yml ==="
cat api-test/src/main/resources/esignet/DBValidatorAndAuditValidator/DBValidatorTest.yml

echo "=== Search for any test case with 'CreateOIDCClient_all_Valid_Smoke_sid_clientId' as outputIdentifier ==="
rg "CreateOIDCClient_all_Valid_Smoke_sid_clientId" api-test/src/main/resources/esignet -g '*.yml' -B 15 | grep -E "uniqueIdentifier|outputIdentifier" | head -20

echo "=== Find which test produces clientId output ==="
rg "outputIdentifier.*clientId" api-test/src/main/resources/esignet -g '*.yml' -B 2 | head -40

Repository: mosip/esignet

Length of output: 4897


Add/verify dependency on OIDC client producer test before $ID: substitution.

All three DB checks depend on $ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$. This YAML has no inline dependency metadata, and the test cases (TC_Esignet_DBValidator_01, TC_Esignet_DBValidator_02, TC_Esignet_DBValidator_03) are not registered in any of the centralized dependency config files (testCaseInterDependency_mock.json, testCaseInterDependency_mosip-id.json, testCaseInterDependency_sunbirdrc.json). Verify that the producer test for this client ID exists and is explicitly linked; otherwise, execution order can break these tests.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@api-test/src/main/resources/esignet/DBValidatorAndAuditValidator/DBValidatorTest.yml`
around lines 2 - 42, The three DB validator cases (uniqueIdentifier
TC_Esignet_DBValidator_01, TC_Esignet_DBValidator_02, TC_Esignet_DBValidator_03)
rely on the producer substitution token
$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$ but no dependency is
recorded; add an explicit dependency on the producing test
(CreateOIDCClient_all_Valid_Smoke_sid or equivalent producer) either by adding
the inline dependency metadata to these YAML entries or by registering these
three test IDs in the appropriate centralized dependency config
(testCaseInterDependency_mock.json / testCaseInterDependency_mosip-id.json /
testCaseInterDependency_sunbirdrc.json) so the producer runs before the DB
validators and the $ID substitution resolves reliably.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
Loading
Loading