Class: DaVinciDTRTestKit::MockAuthorization::SimpleTokenEndpoint

Inherits:
Inferno::DSL::SuiteEndpoint
  • Object
show all
Defined in:
lib/davinci_dtr_test_kit/endpoints/mock_authorization/simple_token_endpoint.rb

Instance Method Summary collapse

Instance Method Details

#make_responseObject

Placeholder for a more complete mock token endpoint



9
10
11
12
# File 'lib/davinci_dtr_test_kit/endpoints/mock_authorization/simple_token_endpoint.rb', line 9

def make_response
  response.body = { access_token: SecureRandom.hex, token_type: 'bearer', expires_in: 3600 }.to_json
  response.status = 200
end

#test_run_identifierObject



4
5
6
# File 'lib/davinci_dtr_test_kit/endpoints/mock_authorization/simple_token_endpoint.rb', line 4

def test_run_identifier
  request.params[:client_id]
end

#update_resultObject



14
15
16
# File 'lib/davinci_dtr_test_kit/endpoints/mock_authorization/simple_token_endpoint.rb', line 14

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