Skip to content

Commit 5445628

Browse files
add scanId to risk management
1 parent 7675678 commit 5445628

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/main/wrapper/CxWrapper.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,10 @@ export class CxWrapper {
229229
return exec.executeResultsCommandsFile(scanId, CxConstants.FORMAT_JSON, CxConstants.FORMAT_JSON_FILE, commands, this.config.pathToExecutable, fileName);
230230
}
231231

232-
async riskManagementResults(projectId: string, limit?: number): Promise<CxCommandOutput> {
232+
async riskManagementResults(projectId: string, scanId: string, limit?: number): Promise<CxCommandOutput> {
233233
const commands: string[] = [CxConstants.CMD_RESULT, CxConstants.CMD_RISK_MANAGEMENT];
234234
commands.push(CxConstants.PROJECT_ID, projectId);
235+
commands.push(CxConstants.SCAN_ID, scanId);
235236

236237
if (limit !== undefined) {
237238
commands.push(CxConstants.CMD_LIMIT, limit.toString());

src/tests/ResultTest.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ describe("Results cases",() => {
7070
it("Risk Management - Successful case", async () => {
7171
const auth = new CxWrapper(cxScanConfig);
7272
const projectId = "a5d99fa4-973d-48b5-86c7-6401487e1d52"
73+
const scanId = "068feb0f-cb8a-4f79-b9b1-e6bec009e517"
7374

7475
const cxCommandOutput: CxCommandOutput = await auth.riskManagementResults(
75-
projectId
76+
projectId, scanId
7677
);
7778

7879
const str = JSON.stringify(cxCommandOutput);
@@ -91,8 +92,11 @@ describe("Results cases",() => {
9192
it("Risk Management - With Limit", async () => {
9293
const auth = new CxWrapper(cxScanConfig);
9394
const projectId = "a5d99fa4-973d-48b5-86c7-6401487e1d52"
95+
const scanId = "068feb0f-cb8a-4f79-b9b1-e6bec009e517"
96+
9497
const cxCommandOutput: CxCommandOutput = await auth.riskManagementResults(
9598
projectId,
99+
scanId,
96100
10
97101
);
98102

0 commit comments

Comments
 (0)