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

project_service.rb « test « integrations « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d72ca928c344081cbe3f4d733e22d173fb24bd9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# frozen_string_literal: true

module Integrations
  module Test
    class ProjectService < Integrations::Test::BaseService
      include Integrations::ProjectTestData
      include Gitlab::Utils::StrongMemoize

      def project
        strong_memoize(:project) do
          integration.project
        end
      end

      private

      def data
        strong_memoize(:data) do
          case event || integration.default_test_event
          when 'push', 'tag_push'
            push_events_data
          when 'note', 'confidential_note'
            note_events_data
          when 'issue', 'confidential_issue'
            issues_events_data
          when 'merge_request'
            merge_requests_events_data
          when 'job'
            job_events_data
          when 'pipeline'
            pipeline_events_data
          when 'wiki_page'
            wiki_page_events_data
          when 'deployment'
            deployment_events_data
          when 'release'
            releases_events_data
          end
        end
      end
    end
  end
end

Integrations::Test::ProjectService.prepend_if_ee('::EE::Integrations::Test::ProjectService')