-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTelemetryTest.java
More file actions
67 lines (61 loc) · 3.66 KB
/
TelemetryTest.java
File metadata and controls
67 lines (61 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package com.checkmarx.ast;
import com.checkmarx.ast.wrapper.CxException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.io.IOException;
/**
* Telemetry AI event test cases covering various parameter scenarios.
*/
class TelemetryTest extends BaseTest {
@Test
void testTelemetryAIEventSuccessfulCaseWithMinimalParametersAiLog() throws CxException, IOException, InterruptedException {
// Test case: AI logging with specific parameters and some empty values
Assertions.assertDoesNotThrow(() -> {
String result = wrapper.telemetryAIEvent(
"Cursor", // aiProvider
"Cursos", // agent
"click", // eventType
"ast-results.viewPackageDetails", // subType
"secrets", // engine
"high", // problemSeverity
"", // scanType (empty)
"", // status (empty)
0 // totalCount
);
}, "Telemetry AI event should execute successfully");
}
@Test
void testTelemetryAIEventSuccessfulCaseWithMinimalParametersDetectionLog() throws CxException, IOException, InterruptedException {
// Test case: Detection logging with most parameters empty and specific scan data
Assertions.assertDoesNotThrow(() -> {
String result = wrapper.telemetryAIEvent(
"", // aiProvider (empty)
"", // agent (empty)
"", // eventType (empty)
"", // subType (empty)
"", // engine (empty)
"", // problemSeverity (empty)
"asca", // scanType
"Critical", // status
10 // totalCount
);
}, "Telemetry AI event should execute successfully for detection log");
}
@Test
void testTelemetryAIEventSuccessfulCaseWithEdgeCaseParameters() throws CxException, IOException, InterruptedException {
// Test case: Edge case with minimal required parameters
Assertions.assertDoesNotThrow(() -> {
String result = wrapper.telemetryAIEvent(
"test-provider", // aiProvider (minimal value)
"java-wrapper", // agent (minimal value)
"", // eventType (empty)
"", // subType (empty)
"", // engine (empty)
"", // problemSeverity (empty)
"", // scanType (empty)
"", // status (empty)
0 // totalCount
);
}, "Telemetry AI event should execute successfully for edge case");
}
}