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

sast.rb « locations « security « reports « ci « factories « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 59b54ecd8f2493eae3ff129cbceeb1490ef2b7b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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