@@ -513,6 +513,29 @@ def test_import_sonar1_reimport_sonar1_active_not_verified(self):
513513 # reimporting the exact same scan shouldn't create any notes
514514 self .assertEqual (notes_count_before , self .db_notes_count ())
515515
516+ # Test the minimum severity flag
517+ def test_import_sonar1_measure_minimum_severity_counts (self ):
518+ # Critical
519+ response_json = self .import_scan_with_params (self .sonarqube_file_name1 , scan_type = self .scan_type_sonarqube_detailed , minimum_severity = "Critical" )
520+ test_id = response_json ['test' ]
521+ # Count all findings
522+ self .assert_finding_count_json (3 , self .get_test_findings_api (test_id ))
523+ self .assert_finding_count_json (3 , self .get_test_findings_api (test_id , severity = "Critical" ))
524+
525+ # High
526+ response_json = self .import_scan_with_params (self .sonarqube_file_name1 , scan_type = self .scan_type_sonarqube_detailed , minimum_severity = "High" )
527+ test_id = response_json ['test' ]
528+ # Count all findings
529+ self .assert_finding_count_json (4 , self .get_test_findings_api (test_id ))
530+ self .assert_finding_count_json (1 , self .get_test_findings_api (test_id , severity = "High" ))
531+
532+ # Low
533+ response_json = self .import_scan_with_params (self .sonarqube_file_name1 , scan_type = self .scan_type_sonarqube_detailed , minimum_severity = "Low" )
534+ test_id = response_json ['test' ]
535+ # Count all findings
536+ self .assert_finding_count_json (6 , self .get_test_findings_api (test_id ))
537+ self .assert_finding_count_json (2 , self .get_test_findings_api (test_id , severity = "Low" ))
538+
516539 # Test re-import with unique_id_from_tool_or_hash_code algorithm
517540 # import veracode_many_findings and then reimport veracode_many_findings again with verified is false
518541 # - reimport, findings stay the same, stay active
0 commit comments