Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/factories/ci/reports/security/locations/sast.rb')
-rw-r--r--spec/factories/ci/reports/security/locations/sast.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/factories/ci/reports/security/locations/sast.rb b/spec/factories/ci/reports/security/locations/sast.rb
new file mode 100644
index 00000000000..59b54ecd8f2
--- /dev/null
+++ b/spec/factories/ci/reports/security/locations/sast.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :ci_reports_security_locations_sast, class: '::Gitlab::Ci::Reports::Security::Locations::Sast' do
+ file_path { 'maven/src/main/java/com/gitlab/security_products/tests/App.java' }
+ start_line { 29 }
+ end_line { 31 }
+ class_name { 'com.gitlab.security_products.tests.App' }
+ method_name { 'insecureCypher' }
+
+ skip_create
+
+ initialize_with do
+ ::Gitlab::Ci::Reports::Security::Locations::Sast.new(**attributes)
+ end
+
+ trait :dynamic do
+ sequence(:file_path, 'a') { |n| "path/#{n}" }
+ start_line { Random.rand(20) }
+ end_line { start_line + Random.rand(5) }
+ end
+ end
+end