Sha256: 41969dd77a3f2aec0776ff053572c5e78a60158d8ef4641f185ed9a6cc6e2d89

Contents?: true

Size: 1.04 KB

Versions: 48

Compression:

Stored size: 1.04 KB

Contents

require 'pact/mock_service/request_handlers/base_administration_request_handler'
require 'pact/mock_service/interactions/verification'

module Pact
  module MockService
    module RequestHandlers

      class MissingInteractionsGet < BaseAdministrationRequestHandler

        def initialize name, logger, session
          super name, logger
          @expected_interactions = session.expected_interactions
          @actual_interactions = session.actual_interactions
        end

        def request_path
          '/interactions/missing'
        end

        def request_method
          'GET'
        end

        def respond env
          verification = Pact::MockService::Interactions::Verification.new(@expected_interactions, @actual_interactions)
          number_of_missing_interactions = verification.missing_interactions.size
          logger.info "Number of missing interactions for mock \"#{name}\" = #{number_of_missing_interactions}"
          json_response({size: number_of_missing_interactions}.to_json)
        end
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 2 rubygems

Version Path
pact-mock_service-2.6.3 lib/pact/mock_service/request_handlers/missing_interactions_get.rb
pact-mock_service-2.6.2 lib/pact/mock_service/request_handlers/missing_interactions_get.rb
pact-mock_service-2.6.0 lib/pact/mock_service/request_handlers/missing_interactions_get.rb
pact-mock_service-2.5.4 lib/pact/mock_service/request_handlers/missing_interactions_get.rb
pact-mock_service-2.5.3 lib/pact/mock_service/request_handlers/missing_interactions_get.rb
pact-mock_service-2.5.1 lib/pact/mock_service/request_handlers/missing_interactions_get.rb
pact-mock_service-2.4.0 lib/pact/mock_service/request_handlers/missing_interactions_get.rb
pact-mock_service-2.3.0 lib/pact/mock_service/request_handlers/missing_interactions_get.rb