diff options
Diffstat (limited to 'spec/factories/ci/reports/security')
-rw-r--r-- | spec/factories/ci/reports/security/identifiers.rb | 15 | ||||
-rw-r--r-- | spec/factories/ci/reports/security/links.rb | 14 | ||||
-rw-r--r-- | spec/factories/ci/reports/security/scanners.rb | 29 |
3 files changed, 58 insertions, 0 deletions
diff --git a/spec/factories/ci/reports/security/identifiers.rb b/spec/factories/ci/reports/security/identifiers.rb new file mode 100644 index 00000000000..5211cb5c54a --- /dev/null +++ b/spec/factories/ci/reports/security/identifiers.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :ci_reports_security_identifier, class: '::Gitlab::Ci::Reports::Security::Identifier' do + external_id { 'PREDICTABLE_RANDOM' } + external_type { 'find_sec_bugs_type' } + name { "#{external_type}-#{external_id}" } + + skip_create + + initialize_with do + ::Gitlab::Ci::Reports::Security::Identifier.new(**attributes) + end + end +end diff --git a/spec/factories/ci/reports/security/links.rb b/spec/factories/ci/reports/security/links.rb new file mode 100644 index 00000000000..77af827e7be --- /dev/null +++ b/spec/factories/ci/reports/security/links.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :ci_reports_security_link, class: '::Gitlab::Ci::Reports::Security::Link' do + name { 'CVE-2020-0202' } + url { 'https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-0202' } + + skip_create + + initialize_with do + ::Gitlab::Ci::Reports::Security::Link.new(**attributes) + end + end +end diff --git a/spec/factories/ci/reports/security/scanners.rb b/spec/factories/ci/reports/security/scanners.rb new file mode 100644 index 00000000000..8b68ebdb47a --- /dev/null +++ b/spec/factories/ci/reports/security/scanners.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :ci_reports_security_scanner, class: '::Gitlab::Ci::Reports::Security::Scanner' do + external_id { 'find_sec_bugs' } + name { 'Find Security Bugs' } + vendor { 'Security Scanner Vendor' } + version { '1.0.0' } + + skip_create + + initialize_with do + ::Gitlab::Ci::Reports::Security::Scanner.new(**attributes) + end + end + + factory :ci_reports_security_scan, class: '::Gitlab::Ci::Reports::Security::Scan' do + status { 'success' } + type { 'sast' } + start_time { 'placeholder' } + end_time { 'placeholder' } + + skip_create + + initialize_with do + ::Gitlab::Ci::Reports::Security::Scan.new(attributes) + end + end +end |