Class: DaVinciPASTestKit::TokenEndpoint

Inherits:
Inferno::DSL::SuiteEndpoint
  • Object
show all
Defined in:
lib/davinci_pas_test_kit/endpoints/token_endpoint.rb

Instance Method Summary collapse

Instance Method Details

#make_responseObject



11
12
13
14
15
16
# File 'lib/davinci_pas_test_kit/endpoints/token_endpoint.rb', line 11

def make_response
  # Placeholder for a more complete mock token endpoint
  response.status = 200
  response.format = :json
  response.body = { access_token: SecureRandom.hex, token_type: 'bearer', expires_in: 300 }.to_json
end

#tagsObject



7
8
9
# File 'lib/davinci_pas_test_kit/endpoints/token_endpoint.rb', line 7

def tags
  [AUTH_TAG]
end

#test_run_identifierObject



3
4
5
# File 'lib/davinci_pas_test_kit/endpoints/token_endpoint.rb', line 3

def test_run_identifier
  URI.decode_www_form(request.body.string).to_h['client_id']
end

#update_resultObject



18
19
20
# File 'lib/davinci_pas_test_kit/endpoints/token_endpoint.rb', line 18

def update_result
  results_repo.update_result(result.id, 'pass')
end