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
Expand Up @@ -101,7 +101,7 @@ public static void main(String[] arg) {
AdminTestUtil.getZoneName();
AdminTestUtil.getLeafZone();

for (int i = 0; i < localLanguageList.size(); i++) {
for (int i = 0; i < 1; i++) {
BaseTestCase.languageList.clear();
BaseTestCase.languageList.add(localLanguageList.get(i));
Comment on lines +104 to 106
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Hardcoding i < 1 removes the empty-list guard the original loop had.

Previously, i < localLanguageList.size() would safely skip the loop body when no languages were configured. Now i < 1 always enters the loop, and localLanguageList.get(0) on Line 106 will throw an IndexOutOfBoundsException if BaseTestCase.getLanguageList() returns an empty list.

If single-language execution is intentional, guard against an empty list or at least use Math.min(1, localLanguageList.size()):

Proposed fix
-			for (int i = 0; i < 1; i++) {
+			for (int i = 0; i < Math.min(1, localLanguageList.size()); i++) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
for (int i = 0; i < 1; i++) {
BaseTestCase.languageList.clear();
BaseTestCase.languageList.add(localLanguageList.get(i));
for (int i = 0; i < Math.min(1, localLanguageList.size()); i++) {
BaseTestCase.languageList.clear();
BaseTestCase.languageList.add(localLanguageList.get(i));
🤖 Prompt for AI Agents
In
`@api-test/src/main/java/io/mosip/testrig/apirig/masterdata/testrunner/MosipTestRunner.java`
around lines 104 - 106, The loop in MosipTestRunner.java that clears and sets
BaseTestCase.languageList uses a hardcoded `i < 1` which will attempt
`localLanguageList.get(0)` even when the source list is empty; modify the loop
to guard against empty lists (e.g., iterate up to Math.min(1,
localLanguageList.size()) or add an explicit check `if
(localLanguageList.isEmpty()) return/continue` before the loop) so that the code
in the block that calls BaseTestCase.languageList.clear() and
BaseTestCase.languageList.add(localLanguageList.get(i)) never executes when
localLanguageList is empty.

SkipTestCaseHandler.clearTestCaseInSkippedList();
Expand Down
286 changes: 239 additions & 47 deletions api-test/src/main/resources/config/masterdata.properties

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ BiometricAttributes:
MasterData_BiometricAttributes_All_Valid_Smoke_sid:
endPoint: /v1/masterdata/biometricattributes
uniqueIdentifier: TC_Masterdata_BiometricAttributes_01
description: Create Biometric Attribute with valid data
description: Verify that the system successfully returns all biometric attributes when the API is called with valid input details and a valid SID
role: admin
checkErrorsOnlyInResponse: true
templateFields: ["langCode"]
Expand All @@ -25,7 +25,7 @@ BiometricAttributes:
MasterData_BiometricAttributes_Invalid_empty_biometricTypeCode:
endPoint: /v1/masterdata/biometricattributes
uniqueIdentifier: TC_Masterdata_BiometricAttributes_02
description: Create Biometric Attributes with empty Biometric Type code value
description: Verify that the system returns an error when the biometricTypeCode field is sent as empty in the Master Data Biometric Attributes API request
role: admin
templateFields: ["langCode"]
restMethod: post
Expand All @@ -52,7 +52,7 @@ BiometricAttributes:
MasterData_BiometricAttributes_Invalid_biometricTypeCode:
endPoint: /v1/masterdata/biometricattributes
uniqueIdentifier: TC_Masterdata_BiometricAttributes_03
description: Create Biometric Attributes with invalid Biometric Type code value
description: Verify that the system returns an error when an invalid biometricTypeCode is provided in the Master Data Biometric Attributes API request
role: admin
templateFields: ["langCode"]
restMethod: post
Expand All @@ -78,7 +78,7 @@ BiometricAttributes:
MasterData_BiometricAttributes_empty_langCode:
endPoint: /v1/masterdata/biometricattributes
uniqueIdentifier: TC_Masterdata_BiometricAttributes_04
description: Create Biometric Attributes with empty lang code value
description: Verify that the system returns an error when the langCode field is sent as empty in the Master Data Biometric Attributes API request
role: admin
restMethod: post
inputTemplate: masterdata/BiometricAttributes/biometricAttributes
Expand All @@ -104,7 +104,7 @@ BiometricAttributes:
MasterData_BiometricAttributes_Invalid_langCode:
endPoint: /v1/masterdata/biometricattributes
uniqueIdentifier: TC_Masterdata_BiometricAttributes_05
description: Create Biometric Attributes with invalid lang code value
description: Verify that the system returns an error when an invalid langCode is provided in the Master Data Biometric Attributes API request
role: admin
restMethod: post
inputTemplate: masterdata/BiometricAttributes/biometricAttributes
Expand All @@ -130,7 +130,7 @@ BiometricAttributes:
MasterData_BiometricAttributes_empty_code:
endPoint: /v1/masterdata/biometricattributes
uniqueIdentifier: TC_Masterdata_BiometricAttributes_06
description: Create Biometric Attributes with empty code value
description: Verify that the system returns an error when the code field is sent as empty in the Master Data Biometric Attributes API request
role: admin
templateFields: ["langCode"]
restMethod: post
Expand All @@ -157,7 +157,7 @@ BiometricAttributes:
MasterData_BiometricAttributes_Invalid_empty_name:
endPoint: /v1/masterdata/biometricattributes
uniqueIdentifier: TC_Masterdata_BiometricAttributes_07
description: Create Biometric Attributes with empty name value
description: Verify that the system returns an error when the name field is empty or invalid in the Master Data Biometric Attributes API request
role: admin
templateFields: ["langCode"]
restMethod: post
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ BlockListedWordValidation:
Masterdata_BlockListedWordValidation_eng_All_Valid_Smoke:
endPoint: /v1/masterdata/blocklistedwords/words
uniqueIdentifier: TC_Masterdata_BlockListedWordValidation_01
description: Validate the Block Listed words
description: Verify that the system successfully validates a block-listed word in English when all input details are valid
role: admin
templateFields: []
restMethod: post
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CreateBlockListedWords:
Masterdata_CreateBlockListedWords_All_Valid_Smoke_Sid:
endPoint: /v1/masterdata/blocklistedwords
uniqueIdentifier: TC_Masterdata_CreateBlockListedWords_01
description: Create block listed words with valid data
description: Verify that the system successfully creates a block-listed word when the API is called with valid input details and a valid SID
role: admin
templateFields: ["description","word"]
restMethod: post
Expand All @@ -21,7 +21,7 @@ CreateBlockListedWords:
Masterdata_CreateBlockListedWords_space_in_word:
endPoint: /v1/masterdata/blocklistedwords
uniqueIdentifier: TC_Masterdata_CreateBlockListedWords_02
description: Create block listed word with space in word value
description: Verify that the system correctly handles creating a block-listed word when the word contains spaces
role: admin
templateFields: ["description","word"]
restMethod: post
Expand All @@ -45,7 +45,7 @@ CreateBlockListedWords:
Masterdata_CreateBlockListedWords_Invalid_BlocklistedWordsLength129:
endPoint: /v1/masterdata/blocklistedwords
uniqueIdentifier: TC_Masterdata_CreateBlockListedWords_03
description: Create block listed words with invalid length of word more than 128 charectars
description: Verify that the system rejects the request when attempting to create a block-listed word that exceeds the maximum allowed length (129 characters)
role: admin
templateFields: ["description"]
restMethod: post
Expand All @@ -69,7 +69,7 @@ CreateBlockListedWords:
Masterdata_CreateBlockListedWords_Invalid_DescriptionLength257:
endPoint: /v1/masterdata/blocklistedwords
uniqueIdentifier: TC_Masterdata_CreateBlockListedWords_04
description: Create block listed words with invalid Description of more than 256 charectars
description: Verify that the system does not allow creating a block-listed word when the description is longer than 257 characters
role: admin
templateFields: ["word"]
restMethod: post
Expand All @@ -93,7 +93,7 @@ CreateBlockListedWords:
Masterdata_CreateBlockListedWords_Invalid_EmptyWord:
endPoint: /v1/masterdata/blocklistedwords
uniqueIdentifier: TC_Masterdata_CreateBlockListedWords_05
description: Create block listed words with empty word value
description: Verify that the system does not allow creating a block-listed word when the word field is empty
role: admin
templateFields: ["description"]
restMethod: post
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ UpdateBlockListedWords:
Masterdata_UpdateBlockListedWords_All_Valid_Smoked_Sid:
endPoint: /v1/masterdata/blocklistedwords
uniqueIdentifier: TC_Masterdata_UpdateBlockListedWords_01
description: Update Block Listed Words with valid data
description: Verify that the system successfully updates a block-listed word when valid details and a valid SID are provided
role: admin
templateFields: ["description","word","oldWord"]
restMethod: put
Expand All @@ -23,7 +23,7 @@ UpdateBlockListedWords:
Masterdata_UpdateBlockListedWords_with_spaces:
endPoint: /v1/masterdata/blocklistedwords
uniqueIdentifier: TC_Masterdata_UpdateBlockListedWords_02
description: Update Block Listed Words with spaces in word
description: Verify that the system correctly updates a block-listed word when the word contains spaces
role: admin
templateFields: ["description","word","oldWord"]
restMethod: put
Expand All @@ -48,7 +48,7 @@ UpdateBlockListedWords:
Masterdata_UpdateBlockListedWords_Valid_WordLength128:
endPoint: /v1/masterdata/blocklistedwords
uniqueIdentifier: TC_Masterdata_UpdateBlockListedWords_03
description: Update Block Listed Words with valid word length of 128 charectars
description: Verify that the system successfully updates a block-listed word when the word length is exactly 128 characters
role: admin
templateFields: ["description"]
restMethod: put
Expand All @@ -72,7 +72,7 @@ UpdateBlockListedWords:
Masterdata_UpdateBlockListedWords_Invalid_BlocklistedWordsLength129:
endPoint: /v1/masterdata/blocklistedwords
uniqueIdentifier: TC_Masterdata_UpdateBlockListedWords_04
description: Update Block Listed Words with invalid length of word more than 128 charectars
description: Verify that the system does not allow updating a block-listed word when the word length is more than 128 characters (129 characters)
role: admin
templateFields: ["description"]
restMethod: put
Expand All @@ -97,7 +97,7 @@ UpdateBlockListedWords:
Masterdata_UpdateBlockListedWords_inValid_descriptionBlank:
endPoint: /v1/masterdata/blocklistedwords
uniqueIdentifier: TC_Masterdata_UpdateBlockListedWords_05
description: Update Block Listed Words with invalid Description empty
description: Verify that the system does not allow updating a block-listed word when the description field is blank
role: admin
templateFields: ["word"]
restMethod: put
Expand All @@ -121,7 +121,7 @@ UpdateBlockListedWords:
Masterdata_UpdateBlockListedWords_Invalid_DescriptionLength257:
endPoint: /v1/masterdata/blocklistedwords
uniqueIdentifier: TC_Masterdata_UpdateBlockListedWords_06
description: Update Block Listed Words with invalid length of Description more than 256 charectars
description: Verify that the system does not allow updating a block-listed word when the description is longer than 257 characters
role: admin
templateFields: ["word"]
restMethod: put
Expand All @@ -146,7 +146,7 @@ UpdateBlockListedWords:
Masterdata_UpdateBlockListedWords_Invalid_EmptyWord:
endPoint: /v1/masterdata/blocklistedwords
uniqueIdentifier: TC_Masterdata_UpdateBlockListedWords_07
description: Update Block Listed Words with invalid word empty
description: Verify that the system does not allow updating a block-listed word when the word field is empty
role: admin
templateFields: ["description"]
restMethod: put
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ BulkUpload:
Masterdata_BulkUpload_Smoke_sid:
endPoint: /v1/admin/bulkupload
uniqueIdentifier: TC_Masterdata_BulkUpload_01
description: Bulk Upload with valid data
description: Verify that the system successfully performs bulk upload with valid details and a valid SID
role: admin
restMethod: post
inputTemplate: masterdata/BulkUpload/bulkUpload
Expand All @@ -20,7 +20,7 @@ BulkUpload:
Masterdata_BulkUpload_update_gender_name:
endPoint: /v1/admin/bulkupload
uniqueIdentifier: TC_Masterdata_BulkUpload_02
description: Update Gender Name from Bulk upload
description: Verify that the system successfully updates the gender name through bulk upload with valid data
role: admin
restMethod: post
inputTemplate: masterdata/BulkUpload/bulkUpload
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CreateApplicationType:
Masterdata_CreateApplicationType_All_Valid_Smoke:
endPoint: /v1/masterdata/applicationtypes
uniqueIdentifier: TC_Masterdata_CreateApplicationType_01
description: Create Application Type with valid data
description: Verify that the system successfully creates an application type when all the details are valid
role: admin
templateFields: ["langCode"]
restMethod: post
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CreateBiometricTypes:
Masterdata_CreateBiometricTypes_All_Valid_Smoke:
endPoint: /v1/masterdata/biometrictypes
uniqueIdentifier: TC_Masterdata_CreateBiometricTypes_01
description: Create Biometric Types with valid data
description: Verify that the system successfully creates a biometric type with valid data
role: admin
templateFields: ["langCode"]
restMethod: post
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CreateIdType:
MasterData_CreateIdType_allValid_smoke:
endPoint: /v1/masterdata/idtypes
uniqueIdentifier: TC_Masterdata_CreateIdType_01
description: Create Id Type with valid data
description: Verify that the system successfully creates an ID type with valid data
role: admin
templateFields: ["langCode"]
restMethod: post
Expand All @@ -21,7 +21,7 @@ CreateIdType:
MasterData_CreateIdType_Invalid_langCode:
endPoint: /v1/masterdata/idtypes
uniqueIdentifier: TC_Masterdata_CreateIdType_02
description: Create Id Type with invalid langcode
description: Verify that the system does not create an ID type when an invalid language code is provided
role: admin
restMethod: post
inputTemplate: masterdata/CreateIdType/createIdType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ DecommisionDevice:
MasterData_DecommisionDevice_All_Valid_Smoke_sid:
endPoint: /v1/masterdata/devices/decommission/{deviceId}
uniqueIdentifier: TC_Masterdata_DecommisionDevice_01
description: Decommission Device with all valid data
description: Verify that the system successfully decommissions a device when all details are valid
role: globalAdmin
checkErrorsOnlyInResponse: true
restMethod: put
Expand All @@ -16,7 +16,7 @@ DecommisionDevice:
MasterData_DecommisionDevice_Invalid_ID:
endPoint: /v1/masterdata/devices/decommission/{deviceId}
uniqueIdentifier: TC_Masterdata_DecommisionDevice_02
description: Decommission Device with invalid deviceId
description: Verify that the system does not decommission a device when an invalid device ID is provided
role: admin
restMethod: put
inputTemplate: masterdata/DecommisionDevice/decommisionDevice
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ DecommisionMachine:
MasterData_DecommisionMachine_Invalid_ID:
endPoint: /v1/masterdata/machines/decommission/{id}
uniqueIdentifier: TC_Masterdata_DecommisionMachine_01
description: Decommission Machine with invalid id
description: Verify that the system does not decommission a machine when an invalid machine ID is provided
role: admin
templateFields: []
restMethod: put
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ DecommissionRegCenter:
MasterData_DecommissionRegCenter_All_Valid_Smoke_sid:
endPoint: /v1/masterdata/registrationcenters/decommission/{regCenterID}
uniqueIdentifier: TC_Masterdata_DecommissionRegCenter_01
description: Decommission Registration Center with valid data
description: Verify that the system successfully decommissions a registration center when all details are valid
role: globalAdmin
checkErrorsOnlyInResponse: true
restMethod: put
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ DeleteBlockListedWords:
Masterdata_DeleteBlockListedWords_valid_smoke:
endPoint: /v1/masterdata/blocklistedwords/{word}
uniqueIdentifier: TC_Masterdata_DeleteBlockListedWords_01
description: Delete Block Listed words with valid data
description: Verify that the system successfully deletes blocklisted words when all details are valid
role: admin
templateFields: ["word","code"]
restMethod: Delete
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ DeleteDevice:
MasterData_DeleteDevice_All_Valid_Smoke_sid:
endPoint: /v1/masterdata/devices/{id}
uniqueIdentifier: TC_Masterdata_DeleteDevice_01
description: Delete Device with valid data
description: Verify that the system successfully deletes a device when all details are valid
role: admin
checkErrorsOnlyInResponse: true
restMethod: delete
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ DeleteDeviceSpec:
MasterData_DeleteDeviceSpec_All_Valid_Smoke_sid:
endPoint: /v1/masterdata/devicespecifications/{id}
uniqueIdentifier: TC_Masterdata_DeleteDeviceSpec_01
description: Delete Device Spec with valid data
description: Verify that the system successfully deletes a device specification when all details are valid
role: admin
checkErrorsOnlyInResponse: true
templateFields: []
Expand All @@ -17,7 +17,7 @@ DeleteDeviceSpec:
MasterData_DeleteDeviceSpec_Invalid_ID:
endPoint: /v1/masterdata/devicespecifications/{id}
uniqueIdentifier: TC_Masterdata_DeleteDeviceSpec_02
description: Delete Device Spec with invalid id
description: Verify that the system does not delete a device specification when an invalid ID is provided
role: admin
templateFields: []
restMethod: delete
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ DeleteDocumentCategory:
MasterData_DeleteDocumentCategory_All_Valid_Smoke_sid:
endPoint: /v1/masterdata/documentcategories/{code}
uniqueIdentifier: TC_Masterdata_DeleteDocumentCategory_01
description: Delete Document Categoty with valid data
description: Verify that the system successfully deletes a document category when all details are valid
role: admin
restMethod: delete
inputTemplate: masterdata/DeleteDocumentCategory/deleteDocumentCategory
Expand All @@ -16,7 +16,7 @@ DeleteDocumentCategory:
MasterData_DeleteDocumentCategory_Invalid_ID:
endPoint: /v1/masterdata/documentcategories/{code}
uniqueIdentifier: TC_Masterdata_DeleteDocumentCategory_02
description: Delete Document Categoty with invalid code
description: Verify that the system does not delete a document category when an invalid ID is provided
role: admin
restMethod: delete
inputTemplate: masterdata/DeleteDocumentCategory/deleteDocumentCategory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ DeleteDocumentType:
MasterData_DeleteDocumentType_All_Valid_Smoke_sid:
endPoint: /v1/masterdata/documenttypes/{code}
uniqueIdentifier: TC_Masterdata_DeleteDocumentType_01
description: Delete Document Type with valid data
description: Verify that the system successfully deletes a document type when all details are valid
role: admin
restMethod: delete
inputTemplate: masterdata/DeleteDocumentType/deleteDocumentType
Expand All @@ -16,7 +16,7 @@ DeleteDocumentType:
MasterData_DeleteDocumentType_Invalid_ID:
endPoint: /v1/masterdata/documenttypes/{code}
uniqueIdentifier: TC_Masterdata_DeleteDocumentType_02
description: Delete Document Type with invalid code
description: Verify that the system does not delete a document type when an invalid ID is provided
role: admin
restMethod: delete
inputTemplate: masterdata/DeleteDocumentType/deleteDocumentType
Expand Down
Loading