File tree Expand file tree Collapse file tree 5 files changed +53
-19
lines changed
main/java/com/checkmarx/ast/wrapper
test/java/com/checkmarx/ast Expand file tree Collapse file tree 5 files changed +53
-19
lines changed Original file line number Diff line number Diff line change @@ -68,13 +68,10 @@ jobs:
68
68
CX_TENANT : ${{ secrets.CX_TENANT }}
69
69
CX_APIKEY : ${{ secrets.CX_APIKEY }}
70
70
71
- - name : Print total coverage percentage
72
- run : |
73
- COVERED_LINES=$(xmllint --xpath "string(//report/counter[@type='LINE']/@covered)" target/site/jacoco/jacoco.xml)
74
- MISSED_LINES=$(xmllint --xpath "string(//report/counter[@type='LINE']/@missed)" target/site/jacoco/jacoco.xml)
75
- TOTAL_LINES=$((COVERED_LINES + MISSED_LINES))
76
- COVERAGE_PERCENTAGE=$(echo "scale=2; $COVERED_LINES / $TOTAL_LINES * 100" | bc)
77
- echo "Total coverage percentage: $COVERAGE_PERCENTAGE%"
71
+ - name : Generate JaCoCo Badge
72
+ uses : cicirello/jacoco-badge-generator@f33476a5a3fd5a4f77cb5eef2ebe728c1dd5b921 # v2.11.0
73
+ with :
74
+ jacoco-csv-file : target/site/jacoco/jacoco.csv
78
75
79
76
- name : Upload JaCoCo coverage report
80
77
uses : actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4
Original file line number Diff line number Diff line change 65
65
<groupId >org.jacoco</groupId >
66
66
<artifactId >jacoco-maven-plugin</artifactId >
67
67
<version >0.8.8</version >
68
+ <configuration >
69
+ <excludes >
70
+ <exclude >**/com/checkmarx/ast/results/**</exclude >
71
+ <exclude >**/com/checkmarx/ast/kicsRealtimeResults/**</exclude >
72
+ <exclude >**/com/checkmarx/ast/asca/**</exclude >
73
+ <exclude >**/com/checkmarx/ast/learnMore/**</exclude >
74
+ <exclude >**/com/checkmarx/ast/predicate/**</exclude >
75
+ <exclude >**/com/checkmarx/ast/scan/**</exclude >
76
+ <exclude >**/com/checkmarx/ast/codebashing/**</exclude >
77
+ <exclude >**/com/checkmarx/ast/remediation/**</exclude >
78
+ <exclude >**/com/checkmarx/ast/project/**</exclude >
79
+ <exclude >**/com/checkmarx/ast/tenant/**</exclude >
80
+ <exclude >**/com/checkmarx/ast/wrapper/CxConstants.class</exclude >
81
+ <exclude >**/com/checkmarx/ast/wrapper/CxException.class</exclude >
82
+ <exclude >**/com/checkmarx/ast/wrapper/CxConfig.class</exclude >
83
+ <exclude >**/com/checkmarx/ast/wrapper/CxBaseObject.class</exclude >
84
+ <exclude >**/com/checkmarx/ast/wrapper/CxConfig$*.class</exclude >
85
+
86
+
87
+ <!-- Add other patterns as needed -->
88
+ </excludes >
89
+ </configuration >
68
90
<executions >
69
91
<execution >
70
92
<goals >
77
99
<goals >
78
100
<goal >report</goal >
79
101
</goals >
80
- <configuration >
81
- <includes >
82
- <include >**/src/main/java/**</include >
83
- <!-- Add other patterns as needed -->
84
- </includes >
85
- </configuration >
86
102
</execution >
87
103
</executions >
88
104
</plugin >
105
+
89
106
<plugin >
90
107
<groupId >com.github.spotbugs</groupId >
91
108
<artifactId >spotbugs-maven-plugin</artifactId >
Original file line number Diff line number Diff line change @@ -63,11 +63,6 @@ List<String> toArguments() {
63
63
return commands ;
64
64
}
65
65
66
- public static final class InvalidCLIConfigException extends Exception {
67
- public InvalidCLIConfigException (String message ) {
68
- super (message );
69
- }
70
- }
71
66
72
67
@ SuppressWarnings ("ALL" )
73
68
public static class CxConfigBuilder {
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ class AuthTest extends BaseTest {
16
16
void testAuthValidate () throws CxException , IOException , InterruptedException {
17
17
Assertions .assertNotNull (wrapper .authValidate ());
18
18
}
19
-
19
+ //
20
20
@ Test
21
21
void testAuthFailure () {
22
22
CxConfig cxConfig = getConfig ();
Original file line number Diff line number Diff line change
1
+ package com .checkmarx .ast ;
2
+
3
+ import com .checkmarx .ast .results .ReportFormat ;
4
+ import org .junit .jupiter .api .Assertions ;
5
+ import org .junit .jupiter .api .Test ;
6
+
7
+ import java .util .List ;
8
+ import java .util .UUID ;
9
+
10
+ class BuildResultsArgumentsTest extends BaseTest {
11
+
12
+ @ Test
13
+ void testBuildResultsArguments_CreatesValidArguments () {
14
+ UUID scanId = UUID .randomUUID ();
15
+ ReportFormat format = ReportFormat .json ;
16
+
17
+ List <String > arguments = wrapper .buildResultsArguments (scanId , format );
18
+ //
19
+
20
+ Assertions .assertNotNull (arguments , "Arguments list should not be null" );
21
+ Assertions .assertFalse (arguments .isEmpty (), "Arguments list should not be empty" );
22
+ Assertions .assertTrue (arguments .contains (scanId .toString ()), "Arguments should contain scan ID" );
23
+ Assertions .assertTrue (arguments .contains (format .toString ()), "Arguments should contain the report format" );
24
+ }
25
+ }
You can’t perform that action at this time.
0 commit comments