From a0d7915914486f6d90cee9ba121954d89070702e Mon Sep 17 00:00:00 2001 From: Alice Lui <54395483+al01010@users.noreply.github.com> Date: Mon, 23 Sep 2024 16:46:29 +0100 Subject: [PATCH] EPBR-5664: Update avg CO2 stubs to whole numbers As this will be more representative of the data returned from the warehouse and remove generation and presence of the text.html file --- .../service_performance_csv_spec.rb | 4 +- .../view_service_performance_spec.rb | 4 +- .../average_co2_emissions/stub.rb | 4 +- .../average_co2_emissions_stub.rb | 14 +- spec/unit/domain/shared_statistics.rb | 8 +- spec/unit/domain/statistics_results_spec.rb | 18 +- spec/unit/use_case/fetch_statistics_spec.rb | 2 +- test.html | 8762 ----------------- 8 files changed, 26 insertions(+), 8790 deletions(-) delete mode 100644 test.html diff --git a/spec/acceptance/service_performance_csv_spec.rb b/spec/acceptance/service_performance_csv_spec.rb index cd4c1526..a8642e0e 100644 --- a/spec/acceptance/service_performance_csv_spec.rb +++ b/spec/acceptance/service_performance_csv_spec.rb @@ -41,7 +41,6 @@ def response_csv_header(body) end it "return a response 200 response" do - save_response_to_file(file: "test", content: response.body) expect(response.status).to eq(200) end @@ -130,7 +129,7 @@ def response_csv_header(body) end it "has a csv with the correct body" do - expect(response.body).to match(/Sep-2021,23834,77.82,15.74,119033,61.74,10.88,7572,68.18,3298,402,861/) + expect(response.body).to match(/Sep-2021,23834,77.82,15,119033,61.74,10,7572,68.18,3298,402,861/) end it "produces a data set with correct number of rows" do @@ -153,7 +152,6 @@ def response_csv_header(body) end it "return a response 200 response" do - File.write("test.html", response.body) expect(response.status).to eq(200) end diff --git a/spec/acceptance/view_service_performance_spec.rb b/spec/acceptance/view_service_performance_spec.rb index da8adaca..ccc6a502 100644 --- a/spec/acceptance/view_service_performance_spec.rb +++ b/spec/acceptance/view_service_performance_spec.rb @@ -99,8 +99,8 @@ end it "the average CO2 values are output" do - expect(response.body).to have_css("#sap-england table.govuk-table td.average-co2-value", text: "15.74") - expect(response.body).to have_css("#rdsap-england table.govuk-table td.average-co2-value", text: "10.88") + expect(response.body).to have_css("#sap-england table.govuk-table td.average-co2-value", text: "15") + expect(response.body).to have_css("#rdsap-england table.govuk-table td.average-co2-value", text: "10") expect(response.body).to have_css("table.govuk-table td.average-co2-value", text: "n/a") end end diff --git a/spec/test_doubles/average_co2_emissions/stub.rb b/spec/test_doubles/average_co2_emissions/stub.rb index bc783ae3..c14554a1 100644 --- a/spec/test_doubles/average_co2_emissions/stub.rb +++ b/spec/test_doubles/average_co2_emissions/stub.rb @@ -6,8 +6,8 @@ def self.get_averages def self.api_data { "data": [ - { "avgCo2Emission" => 10.0, "country" => "Northern Ireland", "yearMonth" => "2022-03" }, - { "avgCo2Emission" => 10.0, "country" => "England", "yearMonth" => "2022-05" }, + { "avgCo2Emission" => 10, "country" => "Northern Ireland", "yearMonth" => "2022-03" }, + { "avgCo2Emission" => 10, "country" => "England", "yearMonth" => "2022-05" }, ] }.to_json end end diff --git a/spec/test_doubles/service_performance/average_co2_emissions_stub.rb b/spec/test_doubles/service_performance/average_co2_emissions_stub.rb index fb01d5e7..1d85b6a5 100644 --- a/spec/test_doubles/service_performance/average_co2_emissions_stub.rb +++ b/spec/test_doubles/service_performance/average_co2_emissions_stub.rb @@ -14,28 +14,28 @@ def self.statistics end private_class_method def self.assessments_stats - { all: [{ "avgCo2Emission": 16.23655, + { all: [{ "avgCo2Emission": 16, "yearMonth": "2021-09", "assessmentType": "SAP" }, - { "avgCo2Emission": 34.345225235, + { "avgCo2Emission": 34, "yearMonth": "2022-03", "assessmentType": "SAP" }, - { "avgCo2Emission": 10.883267, + { "avgCo2Emission": 10, "yearMonth": "2021-09", "assessmentType": "RdSAP" }], - northernIreland: [{ "avgCo2Emission": 34.345225235, + northernIreland: [{ "avgCo2Emission": 34, "country": "Northern Ireland", "yearMonth": "2022-03", "assessmentType": "SAP" }], - england: [{ "avgCo2Emission": 15.7367, + england: [{ "avgCo2Emission": 15, "country": "England", "yearMonth": "2021-09", "assessmentType": "SAP" }, - { "avgCo2Emission": 10.883267, + { "avgCo2Emission": 10, "country": "England", "yearMonth": "2021-09", "assessmentType": "RdSAP" }], - wales: [{ "avgCo2Emission": 16.7364, + wales: [{ "avgCo2Emission": 16, "country": "Wales", "yearMonth": "2022-05", "assessmentType": "SAP" }], diff --git a/spec/unit/domain/shared_statistics.rb b/spec/unit/domain/shared_statistics.rb index ab4afe87..75e1f2dd 100644 --- a/spec/unit/domain/shared_statistics.rb +++ b/spec/unit/domain/shared_statistics.rb @@ -15,10 +15,10 @@ def england { "Month" => "Sep-2021", "SAPs Lodged" => 23_834, "Average SAP Energy Rating" => 77.82, - "Average SAP CO2/sqm emissions" => 15.74, + "Average SAP CO2/sqm emissions" => 15, "RdSAPs Lodged" => 119_033, "Average RdSAP Energy Rating" => 61.74, - "Average RdSAP CO2/sqm emissions" => 10.88, + "Average RdSAP CO2/sqm emissions" => 10, "CEPCs Lodged" => 7572, "Average CEPC Energy Rating" => 68.18, "DECs Lodged" => 3298, @@ -69,10 +69,10 @@ def all_countries { "Month" => "Sep-2021", "SAPs Lodged" => 24_477, "Average SAP Energy Rating" => 77.83, - "Average SAP CO2/sqm emissions" => 16.24, + "Average SAP CO2/sqm emissions" => 16, "RdSAPs Lodged" => 121_499, "Average RdSAP Energy Rating" => 61.71, - "Average RdSAP CO2/sqm emissions" => 10.88, + "Average RdSAP CO2/sqm emissions" => 10, "CEPCs Lodged" => 7718, "Average CEPC Energy Rating" => 68.27, "DECs Lodged" => 3500, diff --git a/spec/unit/domain/statistics_results_spec.rb b/spec/unit/domain/statistics_results_spec.rb index 281e70fe..9bff9389 100644 --- a/spec/unit/domain/statistics_results_spec.rb +++ b/spec/unit/domain/statistics_results_spec.rb @@ -8,13 +8,13 @@ describe "#match_with_warehouse" do it "returns the matching value from the warehouse data" do - expect(domain.match_with_warehouse(month: "2021-09", country: :england, assessment_type: "RdSAP")).to eq [{ assessmentType: "RdSAP", avgCo2Emission: 10.883267, country: "England", yearMonth: "2021-09" }] - expect(domain.match_with_warehouse(month: "2022-03", country: :northernIreland, assessment_type: "SAP")).to eq [{ assessmentType: "SAP", avgCo2Emission: 34.345225235, country: "Northern Ireland", yearMonth: "2022-03" }] + expect(domain.match_with_warehouse(month: "2021-09", country: :england, assessment_type: "RdSAP")).to eq [{ assessmentType: "RdSAP", avgCo2Emission: 10, country: "England", yearMonth: "2021-09" }] + expect(domain.match_with_warehouse(month: "2022-03", country: :northernIreland, assessment_type: "SAP")).to eq [{ assessmentType: "SAP", avgCo2Emission: 34, country: "Northern Ireland", yearMonth: "2022-03" }] end context "when the value of the country key is ':all'" do it "returns the matching value as expected without a country key in the data warehouse item" do - expect(domain.match_with_warehouse(month: "2021-09", country: :all, assessment_type: "SAP")).to eq [{ "avgCo2Emission": 16.23655, "yearMonth": "2021-09", "assessmentType": "SAP" }] + expect(domain.match_with_warehouse(month: "2021-09", country: :all, assessment_type: "SAP")).to eq [{ "avgCo2Emission": 16, "yearMonth": "2021-09", "assessmentType": "SAP" }] end end @@ -28,8 +28,8 @@ describe "#avg_co2" do context "when there is a match with the warehouse data" do it "returns the average co2 for the matching data" do - matched_date_and_country = [{ assessmentType: "SAP", avgCo2Emission: 34.345225235, country: "Northern Ireland", yearMonth: "2022-03" }] - expect(domain.avg_co2(matched_date_and_country:)).to eq 34.35 + matched_date_and_country = [{ assessmentType: "SAP", avgCo2Emission: 34, country: "Northern Ireland", yearMonth: "2022-03" }] + expect(domain.avg_co2(matched_date_and_country:)).to eq 34 end end @@ -45,7 +45,7 @@ context "when there is a CO2 value" do it "updates the register data with the avg CO2 emission value" do reg_data = [{ numAssessments: 20_444, assessmentType: "SAP", ratingAverage: 78.3304347826087, month: "2021-07" }] - avg_co2 = 13.56 + avg_co2 = 13 date = "2021-07" assessment_type = "SAP" domain.update(list: reg_data, avg_co2:, date:, assessment_type:) @@ -71,9 +71,9 @@ end it "matches and joins the expected values" do - expect(domain.results[:england]).to include({ assessmentType: "SAP", avgCo2Emission: 15.74, country: "England", month: "2021-09", numAssessments: 112_499, ratingAverage: 61.7122807017544 }) - expect(domain.results[:england]).to include({ assessmentType: "RdSAP", avgCo2Emission: 10.88, country: "England", month: "2021-09", numAssessments: 121_499, ratingAverage: 61.7122807017544 }) - expect(domain.results[:all]).to include({ assessmentType: "RdSAP", avgCo2Emission: 10.88, month: "2021-09", numAssessments: 121_499, ratingAverage: 61.7122807017544 }) + expect(domain.results[:england]).to include({ assessmentType: "SAP", avgCo2Emission: 15, country: "England", month: "2021-09", numAssessments: 112_499, ratingAverage: 61.7122807017544 }) + expect(domain.results[:england]).to include({ assessmentType: "RdSAP", avgCo2Emission: 10, country: "England", month: "2021-09", numAssessments: 121_499, ratingAverage: 61.7122807017544 }) + expect(domain.results[:all]).to include({ assessmentType: "RdSAP", avgCo2Emission: 10, month: "2021-09", numAssessments: 121_499, ratingAverage: 61.7122807017544 }) end context "when there is no corresponding result from the warehouse data" do diff --git a/spec/unit/use_case/fetch_statistics_spec.rb b/spec/unit/use_case/fetch_statistics_spec.rb index 706e8688..debe5109 100644 --- a/spec/unit/use_case/fetch_statistics_spec.rb +++ b/spec/unit/use_case/fetch_statistics_spec.rb @@ -33,7 +33,7 @@ it "expects SAPs to have average CO2 emissions" do england_result = results[:assessments][:grouped]["SAP"]["England"] - expect(england_result.first[:avgCo2Emission]).to eq 15.74 + expect(england_result.first[:avgCo2Emission]).to eq 15 end end diff --git a/test.html b/test.html deleted file mode 100644 index f0121a3d..00000000 --- a/test.html +++ /dev/null @@ -1,8762 +0,0 @@ - - -
- -
- net_http.rb
request
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/webmock-3.23.1/lib/webmock/http_lib_adapters/net_http.rb
in
- request
- super_with_after_request.call
-
else
-
start_with_connect {
-
super_with_after_request.call
-
}
-
end
-
else
-
raise WebMock::NetConnectNotAllowedError.new(request_signature)
end
-
end
-
-
def start_without_connect
-
raise IOError, 'HTTP session already opened' if @started
-
if block_given?
-
begin
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/faraday-net_http-3.1.1/lib/faraday/adapter/net_http.rb
in
- block in request_with_wrapped_block
- http_response
-
end
-
-
def request_with_wrapped_block(http, env, &block)
-
# Must use Net::HTTP#start and pass it a block otherwise the server's
-
# TCP socket does not close correctly.
-
http.start do |opened_http|
-
opened_http.request create_request(env) do |response|
save_http_response(env, response)
-
-
response.read_body(&block) if block_given?
-
end
-
end
-
end
-
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/webmock-3.23.1/lib/webmock/http_lib_adapters/net_http.rb
in
- start_without_connect
-
-
def start_without_connect
-
raise IOError, 'HTTP session already opened' if @started
-
if block_given?
-
begin
-
@socket = Net::HTTP.socket_type.new
-
@started = true
-
return yield(self)
ensure
-
do_finish
-
end
-
end
-
@socket = Net::HTTP.socket_type.new
-
@started = true
-
self
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/webmock-3.23.1/lib/webmock/http_lib_adapters/net_http.rb
in
- start
-
-
def start(&block)
-
uri = Addressable::URI.parse(WebMock::NetHTTPUtility.get_uri(self))
-
-
if WebMock.net_http_connect_on_start?(uri)
-
super(&block)
-
else
-
start_without_connect(&block)
end
-
end
-
-
def build_net_http_response(webmock_response, request_uri, &block)
-
response = Net::HTTPResponse.send(:response_class, webmock_response.status[0].to_s).new("1.0", webmock_response.status[0].to_s, webmock_response.status[1])
-
body = webmock_response.body
-
body = nil if webmock_response.status[0].to_s == '204'
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/faraday-net_http-3.1.1/lib/faraday/adapter/net_http.rb
in
- request_with_wrapped_block
- env.response.finish(env)
-
http_response
-
end
-
-
def request_with_wrapped_block(http, env, &block)
-
# Must use Net::HTTP#start and pass it a block otherwise the server's
-
# TCP socket does not close correctly.
-
http.start do |opened_http|
opened_http.request create_request(env) do |response|
-
save_http_response(env, response)
-
-
response.read_body(&block) if block_given?
-
end
-
end
-
end
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/faraday-net_http-3.1.1/lib/faraday/adapter/net_http.rb
in
- perform_request
- def perform_request(http, env)
-
if env.stream_response?
-
http_response = env.stream_response do |&on_data|
-
request_with_wrapped_block(http, env, &on_data)
-
end
-
http_response.body = nil
-
else
-
http_response = request_with_wrapped_block(http, env)
end
-
env.response_body = encoded_body(http_response)
-
env.response.finish(env)
-
http_response
-
end
-
-
def request_with_wrapped_block(http, env, &block)
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/faraday-net_http-3.1.1/lib/faraday/adapter/net_http.rb
in
- block in call
- Net::HTTP.new(env[:url].hostname, port, nil)
-
end
-
end
-
-
def call(env)
-
super
-
connection(env) do |http|
-
perform_request(http, env)
rescue *NET_HTTP_EXCEPTIONS => e
-
raise Faraday::SSLError, e if defined?(OpenSSL) && e.is_a?(OpenSSL::SSL::SSLError)
-
-
raise Faraday::ConnectionFailed, e
-
end
-
@app.call env
-
rescue Timeout::Error, Errno::ETIMEDOUT => e
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/faraday-2.10.1/lib/faraday/adapter.rb
in
- connection
- #
-
# @return The return value of the given block, or the HTTP connection object
-
# if no block is given.
-
def connection(env)
-
conn = build_connection(env)
-
return conn unless block_given?
-
-
yield conn
end
-
-
# Close any persistent connections. The adapter should still be usable
-
# after calling close.
-
def close
-
# Possible implementation:
-
# @app.close if @app.respond_to?(:close)
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/faraday-net_http-3.1.1/lib/faraday/adapter/net_http.rb
in
- call
- else
-
Net::HTTP.new(env[:url].hostname, port, nil)
-
end
-
end
-
-
def call(env)
-
super
-
connection(env) do |http|
perform_request(http, env)
-
rescue *NET_HTTP_EXCEPTIONS => e
-
raise Faraday::SSLError, e if defined?(OpenSSL) && e.is_a?(OpenSSL::SSL::SSLError)
-
-
raise Faraday::ConnectionFailed, e
-
end
-
@app.call env
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/faraday-2.10.1/lib/faraday/request/url_encoded.rb
in
- call
- #
-
# @param env [Faraday::Env]
-
def call(env)
-
match_content_type(env) do |data|
-
params = Faraday::Utils::ParamsHash[data]
-
env.body = params.to_query(env.params_encoder)
-
end
-
@app.call env
end
-
-
# @param env [Faraday::Env]
-
# @yield [request_body] Body of the request
-
def match_content_type(env)
-
return unless process_request?(env)
-
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/faraday-2.10.1/lib/faraday/rack_builder.rb
in
- build_response
- # middleware stack.
-
#
-
# @param connection [Faraday::Connection]
-
# @param request [Faraday::Request]
-
#
-
# @return [Faraday::Response]
-
def build_response(connection, request)
-
app.call(build_env(connection, request))
end
-
-
# The "rack app" wrapped in middleware. All requests are sent here.
-
#
-
# The builder is responsible for creating the app object. After this,
-
# the builder gets locked to ensure no further modifications are made
-
# to the middleware stack.
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/faraday-2.10.1/lib/faraday/connection.rb
in
- run_request
- req.options.proxy = proxy_for_request(url)
-
req.url(url) if url
-
req.headers.update(headers) if headers
-
req.body = body if body
-
yield(req) if block_given?
-
end
-
-
builder.build_response(self, request)
end
-
-
# Creates and configures the request object.
-
#
-
# @param method [Symbol]
-
#
-
# @yield [Faraday::Request] if block given
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/oauth2-2.0.9/lib/oauth2/client.rb
in
- execute_request
- [parse, snaky, params, headers]
-
end
-
-
def execute_request(verb, url, opts = {})
-
url = connection.build_url(url).to_s
-
-
begin
-
response = connection.run_request(verb, url, opts[:body], opts[:headers]) do |req|
req.params.update(opts[:params]) if opts[:params]
-
yield(req) if block_given?
-
end
-
rescue Faraday::ConnectionFailed => e
-
raise ConnectionError, e
-
rescue Faraday::TimeoutError => e
-
raise TimeoutError, e
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/oauth2-2.0.9/lib/oauth2/client.rb
in
- request
- # @option opts [Hash] :headers http request headers
-
# @option opts [Boolean] :raise_errors whether or not to raise an OAuth2::Error on 400+ status
-
# code response for this request. Will default to client option
-
# @option opts [Symbol] :parse @see Response::initialize
-
# @option opts [true, false] :snaky (true) @see Response::initialize
-
# @yield [req] @see Faraday::Connection#run_request
-
def request(verb, url, opts = {}, &block)
-
response = execute_request(verb, url, opts, &block)
-
case response.status
-
when 301, 302, 303, 307
-
opts[:redirect_count] ||= 0
-
opts[:redirect_count] += 1
-
return response if opts[:redirect_count] > options[:max_redirects]
-
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/oauth2-2.0.9/lib/oauth2/access_token.rb
in
- request
- #
-
# @param [Symbol] verb the HTTP request method
-
# @param [String] path the HTTP URL path of the request
-
# @param [Hash] opts the options to make the request with
-
# @see Client#request
-
def request(verb, path, opts = {}, &block)
-
configure_authentication!(opts)
-
@client.request(verb, path, opts, &block)
end
-
-
# Make a GET request with the Access Token
-
#
-
# @see AccessToken#request
-
def get(path, opts = {}, &block)
-
request(:get, path, opts, &block)
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/oauth2-2.0.9/lib/oauth2/access_token.rb
in
- get
- @client.request(verb, path, opts, &block)
-
end
-
-
# Make a GET request with the Access Token
-
#
-
# @see AccessToken#request
-
def get(path, opts = {}, &block)
-
request(:get, path, opts, &block)
end
-
-
# Make a POST request with the Access Token
-
#
-
# @see AccessToken#request
-
def post(path, opts = {}, &block)
-
request(:post, path, opts, &block)
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/epb-auth-tools-1.1.0/lib/http_client.rb
in
- request
-
-
def request(method_name, *args, &block)
-
refresh? && refresh
-
-
args[0] = @base_uri + args[0]
-
-
if @authenticated_client.respond_to? method_name
-
response = @authenticated_client.send method_name, *args, &block
if response.status == 401
-
# a 401 here is assumed to be due to an expired token
-
# otherwise, refreshing the token and calling again should make no difference to the ultimate response
-
refresh
-
response = @authenticated_client.send method_name, *args, &block
-
end
-
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/epb-auth-tools-1.1.0/lib/http_client.rb
in
- block (2 levels) in delegate
- def refresh?
-
@authenticated_client.nil? || @authenticated_client.expired?
-
end
-
-
def self.delegate(*methods)
-
methods.each do |method_name|
-
define_method(method_name) do |*args, &block|
-
request method_name, *args, &block
end
-
end
-
end
-
-
delegate :get, :post, :put
-
-
def request(method_name, *args, &block)
-
/Users/barryhalper/code/communitiesuk/epb-frontend/lib/gateway/reporting_base_gateway.rb
in
- block in get
- def initialize(api_client)
-
@internal_api_client = api_client
-
end
-
-
private
-
-
def get(route:)
-
response = Helper::Response.ensure_good { @internal_api_client.get(route) }
JSON.parse(response.body, symbolize_names: true)
-
end
-
end
-
end
-
/Users/barryhalper/code/communitiesuk/epb-frontend/lib/helper/response.rb
in
- ensure_good
- module Helper
-
module Response
-
def self.ensure_good(&block)
-
begin
-
response = yield block
rescue Faraday::TimeoutError => e
-
# raise a timeout error straight away
-
raise Errors::RequestTimeoutError,
-
sprintf(
-
"API request timed out. Message from %s: \"%s\"",
-
e.class,
-
e.message,
-
/Users/barryhalper/code/communitiesuk/epb-frontend/lib/gateway/reporting_base_gateway.rb
in
- get
- def initialize(api_client)
-
@internal_api_client = api_client
-
end
-
-
private
-
-
def get(route:)
-
response = Helper::Response.ensure_good { @internal_api_client.get(route) }
JSON.parse(response.body, symbolize_names: true)
-
end
-
end
-
end
-
/Users/barryhalper/code/communitiesuk/epb-frontend/lib/gateway/average_co2_emissions_gateway.rb
in
- fetch
- module Gateway
-
class AverageCo2EmissionsGateway < Gateway::ReportingBaseGateway
-
def fetch
-
route = "/api/avg-co2-emissions"
-
get(route:)
end
-
end
-
end
-
/Users/barryhalper/code/communitiesuk/epb-frontend/lib/use_case/fetch_statistics_csv.rb
in
- execute
- # frozen_string_literal: true
-
-
module UseCase
-
class FetchStatisticsCsv < UseCase::FetchStatisticsBase
-
def execute(country = "all")
-
register_data = @statistics_gateway.fetch[:data]
-
warehouse_data = @co2_gateway.fetch[:data]
@domain = Domain::StatisticsResults.new(register_data: register_data[:assessments], warehouse_data:)
-
@domain.set_results unless warehouse_data.empty?
-
data = @domain.get_results[:assessments]
-
country_key = country == "northern-ireland" ? :northernIreland : country.to_sym
-
results = data.key?(country_key.to_sym) ? data[country_key.to_sym] : data[:all]
-
-
return_array = []
-
/Users/barryhalper/code/communitiesuk/epb-frontend/lib/frontend_service.rb
in
- block in <class:FrontendService>
- show(erb_template, data)
-
rescue StandardError => e
-
return server_error(e)
-
end
-
-
get "/service-performance/download-csv" do
-
use_case = @container.get_object(:fetch_statistics_csv_use_case)
-
data = use_case.execute(params["country"])
-
content_type "application/csv"
-
attachment params["country"] ? "service-performance-#{params['country']}.csv" : "service-performance-all-regions.csv"
-
-
to_csv(data)
-
rescue StandardError => e
-
content_type "text/html"
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- call
-
-
pattern = compile(path, route_mustermann_opts)
-
method_name = "#{verb} #{path}"
-
unbound_method = generate_method(method_name, &block)
-
conditions = @conditions
-
@conditions = []
-
wrapper = block.arity.zero? ?
-
proc { |a, _p| unbound_method.bind(a).call } :
proc { |a, p| unbound_method.bind(a).call(*p) }
-
-
[pattern, conditions, wrapper]
-
end
-
-
def compile(path, route_mustermann_opts = {})
-
Mustermann.new(path, **mustermann_opts.merge(route_mustermann_opts))
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- block in compile!
-
-
pattern = compile(path, route_mustermann_opts)
-
method_name = "#{verb} #{path}"
-
unbound_method = generate_method(method_name, &block)
-
conditions = @conditions
-
@conditions = []
-
wrapper = block.arity.zero? ?
-
proc { |a, _p| unbound_method.bind(a).call } :
proc { |a, p| unbound_method.bind(a).call(*p) }
-
-
[pattern, conditions, wrapper]
-
end
-
-
def compile(path, route_mustermann_opts = {})
-
Mustermann.new(path, **mustermann_opts.merge(route_mustermann_opts))
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- block (3 levels) in route!
- routes = base.routes[@request.request_method]
-
-
routes&.each do |pattern, conditions, block|
-
response.delete_header('content-type') unless @pinned_response
-
-
returned_pass_block = process_route(pattern, conditions) do |*args|
-
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
-
route_eval { block[*args] }
end
-
-
# don't wipe out pass_block in superclass
-
pass_block = returned_pass_block if returned_pass_block
-
end
-
-
# Run routes defined in superclass.
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- route_eval
-
-
route_eval(&pass_block) if pass_block
-
route_missing
-
end
-
-
# Run a route block and throw :halt with the result.
-
def route_eval
-
throw :halt, yield
end
-
-
# If the current request matches pattern and conditions, fill params
-
# with keys and call the given block.
-
# Revert params afterwards.
-
#
-
# Returns pass block.
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- block (2 levels) in route!
- routes = base.routes[@request.request_method]
-
-
routes&.each do |pattern, conditions, block|
-
response.delete_header('content-type') unless @pinned_response
-
-
returned_pass_block = process_route(pattern, conditions) do |*args|
-
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
-
route_eval { block[*args] }
end
-
-
# don't wipe out pass_block in superclass
-
pass_block = returned_pass_block if returned_pass_block
-
end
-
-
# Run routes defined in superclass.
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- block in process_route
- @params[:captures] = force_encoding(captures) unless captures.nil? || captures.empty?
-
else
-
values += params.values.flatten
-
end
-
-
catch(:pass) do
-
conditions.each { |c| throw :pass if c.bind(self).call == false }
-
block ? block[self, values] : yield(self, values)
end
-
rescue StandardError
-
@env['sinatra.error.params'] = @params
-
raise
-
ensure
-
params ||= {}
-
params.each { |k, _| @params.delete(k) } unless @env['sinatra.error.params']
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- catch
- captures = pattern.match(route).captures.map { |c| URI_INSTANCE.unescape(c) if c }
-
values += captures
-
@params[:captures] = force_encoding(captures) unless captures.nil? || captures.empty?
-
else
-
values += params.values.flatten
-
end
-
-
catch(:pass) do
conditions.each { |c| throw :pass if c.bind(self).call == false }
-
block ? block[self, values] : yield(self, values)
-
end
-
rescue StandardError
-
@env['sinatra.error.params'] = @params
-
raise
-
ensure
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- process_route
- captures = pattern.match(route).captures.map { |c| URI_INSTANCE.unescape(c) if c }
-
values += captures
-
@params[:captures] = force_encoding(captures) unless captures.nil? || captures.empty?
-
else
-
values += params.values.flatten
-
end
-
-
catch(:pass) do
conditions.each { |c| throw :pass if c.bind(self).call == false }
-
block ? block[self, values] : yield(self, values)
-
end
-
rescue StandardError
-
@env['sinatra.error.params'] = @params
-
raise
-
ensure
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- block in route!
- # Run routes defined on the class and all superclasses.
-
def route!(base = settings, pass_block = nil)
-
routes = base.routes[@request.request_method]
-
-
routes&.each do |pattern, conditions, block|
-
response.delete_header('content-type') unless @pinned_response
-
-
returned_pass_block = process_route(pattern, conditions) do |*args|
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
-
route_eval { block[*args] }
-
end
-
-
# don't wipe out pass_block in superclass
-
pass_block = returned_pass_block if returned_pass_block
-
end
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- each
- end
-
end
-
-
# Run routes defined on the class and all superclasses.
-
def route!(base = settings, pass_block = nil)
-
routes = base.routes[@request.request_method]
-
-
routes&.each do |pattern, conditions, block|
response.delete_header('content-type') unless @pinned_response
-
-
returned_pass_block = process_route(pattern, conditions) do |*args|
-
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
-
route_eval { block[*args] }
-
end
-
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- route!
- end
-
end
-
-
# Run routes defined on the class and all superclasses.
-
def route!(base = settings, pass_block = nil)
-
routes = base.routes[@request.request_method]
-
-
routes&.each do |pattern, conditions, block|
response.delete_header('content-type') unless @pinned_response
-
-
returned_pass_block = process_route(pattern, conditions) do |*args|
-
env['sinatra.route'] = "#{@request.request_method} #{pattern}"
-
route_eval { block[*args] }
-
end
-
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- block in dispatch!
- end
-
-
invoke do
-
static! if settings.static? && (request.get? || request.head?)
-
filter! :before do
-
@pinned_response = !response['content-type'].nil?
-
end
-
route!
end
-
rescue ::Exception => e
-
invoke { handle_exception!(e) }
-
ensure
-
begin
-
filter! :after unless env['sinatra.static_file']
-
rescue ::Exception => e
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- catch
- env['sinatra.static_file'] = path
-
cache_control(*settings.static_cache_control) if settings.static_cache_control?
-
send_file path, options.merge(disposition: nil)
-
end
-
-
# Run the block with 'throw :halt' support and apply result to the response.
-
def invoke(&block)
-
res = catch(:halt, &block)
-
res = [res] if (Integer === res) || (String === res)
-
if (Array === res) && (Integer === res.first)
-
res = res.dup
-
status(res.shift)
-
body(res.pop)
-
headers(*res)
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- invoke
- env['sinatra.static_file'] = path
-
cache_control(*settings.static_cache_control) if settings.static_cache_control?
-
send_file path, options.merge(disposition: nil)
-
end
-
-
# Run the block with 'throw :halt' support and apply result to the response.
-
def invoke(&block)
-
res = catch(:halt, &block)
-
res = [res] if (Integer === res) || (String === res)
-
if (Array === res) && (Integer === res.first)
-
res = res.dup
-
status(res.shift)
-
body(res.pop)
-
headers(*res)
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- dispatch!
- @params.merge!(@request.params).each do |key, val|
-
next unless val.respond_to?(:force_encoding)
-
-
val = val.dup if val.frozen?
-
@params[key] = force_encoding(val)
-
end
-
-
invoke do
static! if settings.static? && (request.get? || request.head?)
-
filter! :before do
-
@pinned_response = !response['content-type'].nil?
-
end
-
route!
-
end
-
rescue ::Exception => e
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- block in call!
- @env = env
-
@params = IndifferentHash.new
-
@request = Request.new(env)
-
@response = Response.new
-
@pinned_response = nil
-
template_cache.clear if settings.reload_templates
-
-
invoke { dispatch! }
invoke { error_block!(response.status) } unless @env['sinatra.error']
-
-
unless @response['content-type']
-
if Array === body && body[0].respond_to?(:content_type)
-
content_type body[0].content_type
-
elsif (default = settings.default_content_type)
-
content_type default
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- catch
- env['sinatra.static_file'] = path
-
cache_control(*settings.static_cache_control) if settings.static_cache_control?
-
send_file path, options.merge(disposition: nil)
-
end
-
-
# Run the block with 'throw :halt' support and apply result to the response.
-
def invoke(&block)
-
res = catch(:halt, &block)
-
res = [res] if (Integer === res) || (String === res)
-
if (Array === res) && (Integer === res.first)
-
res = res.dup
-
status(res.shift)
-
body(res.pop)
-
headers(*res)
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- invoke
- env['sinatra.static_file'] = path
-
cache_control(*settings.static_cache_control) if settings.static_cache_control?
-
send_file path, options.merge(disposition: nil)
-
end
-
-
# Run the block with 'throw :halt' support and apply result to the response.
-
def invoke(&block)
-
res = catch(:halt, &block)
-
res = [res] if (Integer === res) || (String === res)
-
if (Array === res) && (Integer === res.first)
-
res = res.dup
-
status(res.shift)
-
body(res.pop)
-
headers(*res)
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- call!
- @env = env
-
@params = IndifferentHash.new
-
@request = Request.new(env)
-
@response = Response.new
-
@pinned_response = nil
-
template_cache.clear if settings.reload_templates
-
-
invoke { dispatch! }
invoke { error_block!(response.status) } unless @env['sinatra.error']
-
-
unless @response['content-type']
-
if Array === body && body[0].respond_to?(:content_type)
-
content_type body[0].content_type
-
elsif (default = settings.default_content_type)
-
content_type default
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- call
- @template_cache = TemplateCache.new
-
@pinned_response = nil # whether a before! filter pinned the content-type
-
yield self if block_given?
-
end
-
-
# Rack call interface.
-
def call(env)
-
dup.call!(env)
end
-
-
def call!(env) # :nodoc:
-
@env = env
-
@params = IndifferentHash.new
-
@request = Request.new(env)
-
@response = Response.new
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rack-protection-4.0.0/lib/rack/protection/xss_header.rb
in
- call
- #
-
# Options:
-
# xss_mode:: How the browser should prevent the attack (default: :block)
-
class XSSHeader < Base
-
default_options xss_mode: :block, nosniff: true
-
-
def call(env)
-
status, headers, body = @app.call(env)
headers['x-xss-protection'] ||= "1; mode=#{options[:xss_mode]}" if html? headers
-
headers['x-content-type-options'] ||= 'nosniff' if options[:nosniff]
-
[status, headers, body]
-
end
-
end
-
end
-
end
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rack-protection-4.0.0/lib/rack/protection/path_traversal.rb
in
- call
- #
-
# Unescapes '/' and '.', expands +path_info+.
-
# Thus <tt>GET /foo/%2e%2e%2fbar</tt> becomes <tt>GET /bar</tt>.
-
class PathTraversal < Base
-
def call(env)
-
path_was = env['PATH_INFO']
-
env['PATH_INFO'] = cleanup path_was if path_was && !path_was.empty?
-
app.call env
ensure
-
env['PATH_INFO'] = path_was
-
end
-
-
def cleanup(path)
-
encoding = path.encoding
-
dot = '.'.encode(encoding)
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rack-protection-4.0.0/lib/rack/protection/json_csrf.rb
in
- call
- class JsonCsrf < Base
-
default_options allow_if: nil
-
-
alias react deny
-
-
def call(env)
-
request = Request.new(env)
-
status, headers, body = app.call(env)
-
if has_vector?(request, headers)
-
warn env, "attack prevented by #{self.class}"
-
-
react_and_close(env, body) or [status, headers, body]
-
else
-
[status, headers, body]
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rack-protection-4.0.0/lib/rack/protection/base.rb
in
- call
- end
-
-
def call(env)
-
unless accepts? env
-
instrument env
-
result = react env
-
end
-
result or app.call(env)
end
-
-
def react(env)
-
result = send(options[:reaction], env)
-
result if (Array === result) && (result.size == 3)
-
end
-
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rack-protection-4.0.0/lib/rack/protection/base.rb
in
- call
- end
-
-
def call(env)
-
unless accepts? env
-
instrument env
-
result = react env
-
end
-
result or app.call(env)
end
-
-
def react(env)
-
result = send(options[:reaction], env)
-
result if (Array === result) && (result.size == 3)
-
end
-
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rack-protection-4.0.0/lib/rack/protection/frame_options.rb
in
- call
- frame_options = options[:frame_options]
-
frame_options = options[:frame_options].to_s.upcase unless frame_options.respond_to? :to_str
-
frame_options.to_str
-
end
-
end
-
-
def call(env)
-
status, headers, body = @app.call(env)
headers['x-frame-options'] ||= frame_options if html? headers
-
[status, headers, body]
-
end
-
end
-
end
-
end
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rack-3.1.7/lib/rack/null_logger.rb
in
- call
- class NullLogger
-
def initialize(app)
-
@app = app
-
end
-
-
def call(env)
-
env[RACK_LOGGER] = self
-
@app.call(env)
end
-
-
def info(progname = nil, &block); end
-
def debug(progname = nil, &block); end
-
def warn(progname = nil, &block); end
-
def error(progname = nil, &block); end
-
def fatal(progname = nil, &block); end
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rack-3.1.7/lib/rack/head.rb
in
- call
- # all other requests unchanged.
-
class Head
-
def initialize(app)
-
@app = app
-
end
-
-
def call(env)
-
_, _, body = response = @app.call(env)
-
if env[REQUEST_METHOD] == HEAD
-
response[2] = Rack::BodyProxy.new([]) do
-
body.close if body.respond_to? :close
-
end
-
end
-
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/show_exceptions.rb
in
- call
- def @@eats_errors.puts(*) end
-
-
def initialize(app)
-
@app = app
-
end
-
-
def call(env)
-
@app.call(env)
rescue Exception => e
-
errors = env['rack.errors']
-
env['rack.errors'] = @@eats_errors
-
-
if prefers_plain_text?(env)
-
content_type = 'text/plain'
-
body = dump_exception(e)
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- call
- # Some Rack handlers implement an extended body object protocol, however,
-
# some middleware (namely Rack::Lint) will break it by not mirroring the methods in question.
-
# This middleware will detect an extended body object and will make sure it reaches the
-
# handler directly. We do this here, so our middleware and middleware set up by the app will
-
# still be able to run.
-
class ExtendedRack < Struct.new(:app)
-
def call(env)
-
result = app.call(env)
callback = env['async.callback']
-
return result unless callback && async?(*result)
-
-
after_response { callback.call result }
-
setup_close(env, *result)
-
throw :async
-
end
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- call
- end
-
-
def helpers
-
@instance
-
end
-
-
def call(env)
-
@stack.call(env)
end
-
-
def inspect
-
"#<#{@instance.class} app_file=#{settings.app_file.inspect}>"
-
end
-
end
-
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- block in call
- setup_default_middleware builder
-
setup_middleware builder
-
builder.run app
-
builder
-
end
-
-
def call(env)
-
synchronize { prototype.call(env) }
end
-
-
# Like Kernel#caller but excluding certain magic entries and without
-
# line / method information; the resulting array contains filenames only.
-
def caller_files
-
cleaned_caller(1).flatten
-
end
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- synchronize
- end
-
-
@@mutex = Mutex.new
-
def synchronize(&block)
-
if lock?
-
@@mutex.synchronize(&block)
-
else
-
yield
end
-
end
-
-
# used for deprecation warnings
-
def warn_for_deprecation(message)
-
warn message + "\n\tfrom #{cleaned_caller.first.join(':')}"
-
end
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/sinatra-4.0.0/lib/sinatra/base.rb
in
- call
- setup_default_middleware builder
-
setup_middleware builder
-
builder.run app
-
builder
-
end
-
-
def call(env)
-
synchronize { prototype.call(env) }
end
-
-
# Like Kernel#caller but excluding certain magic entries and without
-
# line / method information; the resulting array contains filenames only.
-
def caller_files
-
cleaned_caller(1).flatten
-
end
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rack-3.1.7/lib/rack/builder.rb
in
- call
- app
-
end
-
-
# Call the Rack application generated by this builder instance. Note that
-
# this rebuilds the Rack application and runs the warmup code (if any)
-
# every time it is called, so it should not be used if performance is important.
-
def call(env)
-
to_app.call(env)
end
-
-
private
-
-
# Generate a URLMap instance by generating new Rack applications for each
-
# map block in this instance.
-
def generate_map(default_app, mapping)
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rack-test-2.1.0/lib/rack/test.rb
in
- process_request
- end
-
-
# Submit the request with the given URI and rack environment to
-
# the mock session. Returns and potentially yields the last response.
-
def process_request(uri, env)
-
env['HTTP_COOKIE'] ||= cookie_jar.for(uri)
-
@last_request = Rack::Request.new(env)
-
status, headers, body = @app.call(env).to_a
-
@last_response = MockResponse.new(status, headers, body, env['rack.errors'].flush)
-
close_body(body)
-
cookie_jar.merge(last_response.headers['set-cookie'], uri)
-
@after_request.each(&:call)
-
@last_response.finish
-
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rack-test-2.1.0/lib/rack/test.rb
in
- custom_request
- # Issue a request using the given HTTP verb for the given URI, with optional
-
# params and rack environment. Example:
-
#
-
# custom_request "LINK", "/"
-
def custom_request(verb, uri, params = {}, env = {}, &block)
-
uri = parse_uri(uri, env)
-
env = env_for(uri, env.merge(method: verb.to_s.upcase, params: params))
-
process_request(uri, env, &block)
end
-
-
# Set a header to be included on all subsequent requests through the
-
# session. Use a value of nil to remove a previously configured header.
-
#
-
# In accordance with the Rack spec, headers will be included in the Rack
-
# environment hash in HTTP_USER_AGENT form. Example:
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rack-test-2.1.0/lib/rack/test.rb
in
- get
- @last_response = nil
-
clear_cookies
-
end
-
-
%w[get post put patch delete options head].each do |method_name|
-
class_eval(<<-END, __FILE__, __LINE__+1)
-
def #{method_name}(uri, params = {}, env = {}, &block)
-
custom_request('#{method_name.upcase}', uri, params, env, &block)
end
-
END
-
end
-
-
# Run a block after the each request completes.
-
def after_request(&block)
-
@after_request << block
-
/Users/barryhalper/.rvm/rubies/ruby-3.3.4/lib/ruby/3.3.0/forwardable.rb
in
- get
- begin
-
#{accessor}
-
end#{method_call}
-
end
-
end
-
end;
-
end
-
end
-
# SingleForwardable can be used to setup delegation at the object level as well.
-
#
-
# printer = String.new
-
# printer.extend SingleForwardable # prepare object for delegation
-
# printer.def_delegator "STDOUT", "puts" # add delegation for STDOUT.puts()
-
# printer.puts "Howdy!"
-
/Users/barryhalper/code/communitiesuk/epb-frontend/spec/acceptance/service_performance_csv_spec.rb
in
- block (3 levels) in <top (required)>
- it "produces a data set with correct number of rows" do
-
expect(parsed_data.length).to eq(2)
-
end
-
end
-
-
describe "get . find-energy-certificate/service-performance/download-csv?country=northern-ireland" do
-
let(:response) do
-
get "http://find-energy-certificate.epb-frontend/service-performance/download-csv?country=northern-ireland"
end
-
-
let(:parsed_data) do
-
CSV.parse(response.body, headers: true)
-
end
-
-
before do
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/memoized_helpers.rb
in
- block (2 levels) in let
- end
-
-
# Apply the memoization. The method has been defined in an ancestor
-
# module so we can use `super` here to get the value.
-
if block.arity == 1
-
define_method(name) { __memoized.fetch_or_store(name) { super(RSpec.current_example, &nil) } }
-
else
-
define_method(name) { __memoized.fetch_or_store(name) { super(&nil) } }
end
-
end
-
-
# Just like `let`, except the block is invoked by an implicit `before`
-
# hook. This serves a dual purpose of setting up state and providing a
-
# memoized reference to that state.
-
#
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/memoized_helpers.rb
in
- block (3 levels) in fetch_or_store
- @memoized = {}
-
@mutex = Support::ReentrantMutex.new
-
end
-
-
def fetch_or_store(key)
-
@memoized.fetch(key) do # only first access pays for synchronization
-
@mutex.synchronize do
-
@memoized.fetch(key) { @memoized[key] = yield }
end
-
end
-
end
-
end
-
-
# @private
-
class NonThreadSafeMemoized
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/memoized_helpers.rb
in
- fetch
- @memoized = {}
-
@mutex = Support::ReentrantMutex.new
-
end
-
-
def fetch_or_store(key)
-
@memoized.fetch(key) do # only first access pays for synchronization
-
@mutex.synchronize do
-
@memoized.fetch(key) { @memoized[key] = yield }
end
-
end
-
end
-
end
-
-
# @private
-
class NonThreadSafeMemoized
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/memoized_helpers.rb
in
- block (2 levels) in fetch_or_store
- @memoized = {}
-
@mutex = Support::ReentrantMutex.new
-
end
-
-
def fetch_or_store(key)
-
@memoized.fetch(key) do # only first access pays for synchronization
-
@mutex.synchronize do
-
@memoized.fetch(key) { @memoized[key] = yield }
end
-
end
-
end
-
end
-
-
# @private
-
class NonThreadSafeMemoized
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-support-3.13.1/lib/rspec/support/reentrant_mutex.rb
in
- synchronize
- @owner = nil
-
@count = 0
-
@mutex = Mutex.new
-
end
-
-
def synchronize
-
enter
-
yield
ensure
-
exit
-
end
-
-
private
-
-
# This is fixing a bug #501 that is specific to Ruby 3.0. The new implementation
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/memoized_helpers.rb
in
- block in fetch_or_store
- def initialize
-
@memoized = {}
-
@mutex = Support::ReentrantMutex.new
-
end
-
-
def fetch_or_store(key)
-
@memoized.fetch(key) do # only first access pays for synchronization
-
@mutex.synchronize do
@memoized.fetch(key) { @memoized[key] = yield }
-
end
-
end
-
end
-
end
-
-
# @private
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/memoized_helpers.rb
in
- fetch
- class ThreadsafeMemoized
-
def initialize
-
@memoized = {}
-
@mutex = Support::ReentrantMutex.new
-
end
-
-
def fetch_or_store(key)
-
@memoized.fetch(key) do # only first access pays for synchronization
@mutex.synchronize do
-
@memoized.fetch(key) { @memoized[key] = yield }
-
end
-
end
-
end
-
end
-
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/memoized_helpers.rb
in
- fetch_or_store
- class ThreadsafeMemoized
-
def initialize
-
@memoized = {}
-
@mutex = Support::ReentrantMutex.new
-
end
-
-
def fetch_or_store(key)
-
@memoized.fetch(key) do # only first access pays for synchronization
@mutex.synchronize do
-
@memoized.fetch(key) { @memoized[key] = yield }
-
end
-
end
-
end
-
end
-
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/memoized_helpers.rb
in
- block in let
- end
-
-
# Apply the memoization. The method has been defined in an ancestor
-
# module so we can use `super` here to get the value.
-
if block.arity == 1
-
define_method(name) { __memoized.fetch_or_store(name) { super(RSpec.current_example, &nil) } }
-
else
-
define_method(name) { __memoized.fetch_or_store(name) { super(&nil) } }
end
-
end
-
-
# Just like `let`, except the block is invoked by an implicit `before`
-
# hook. This serves a dual purpose of setting up state and providing a
-
# memoized reference to that state.
-
#
-
/Users/barryhalper/code/communitiesuk/epb-frontend/spec/acceptance/service_performance_csv_spec.rb
in
- block (3 levels) in <top (required)>
- end
-
-
before do
-
stats_web_mock(ServicePerformance::MonthsStatsDataStub.get_data)
-
end
-
-
it "return a response 200 response" do
-
File.write('test.html', response.body)
expect(response.status).to eq(200)
-
end
-
-
it "has a content type header for csv" do
-
expect(response.original_headers["Content-Type"]).to eq("application/csv")
-
end
-
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/example.rb
in
- instance_exec
- if skipped?
-
Pending.mark_pending! self, skip
-
elsif !RSpec.configuration.dry_run?
-
with_around_and_singleton_context_hooks do
-
begin
-
run_before_example
-
RSpec.current_scope = :example
-
@example_group_instance.instance_exec(self, &@example_block)
-
if pending?
-
Pending.mark_fixed! self
-
-
raise Pending::PendingExampleFixedError,
-
'Expected example to fail since it is pending, but it passed.',
-
[location]
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/example.rb
in
- block in run
- if skipped?
-
Pending.mark_pending! self, skip
-
elsif !RSpec.configuration.dry_run?
-
with_around_and_singleton_context_hooks do
-
begin
-
run_before_example
-
RSpec.current_scope = :example
-
@example_group_instance.instance_exec(self, &@example_block)
-
if pending?
-
Pending.mark_fixed! self
-
-
raise Pending::PendingExampleFixedError,
-
'Expected example to fail since it is pending, but it passed.',
-
[location]
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/example.rb
in
- block in with_around_and_singleton_context_hooks
- @example_group_instance.setup_mocks_for_rspec
-
hooks.run(:before, :example, self)
-
end
-
-
def with_around_and_singleton_context_hooks
-
singleton_context_hooks_host = example_group_instance.singleton_class
-
singleton_context_hooks_host.run_before_context_hooks(example_group_instance)
-
with_around_example_hooks { yield }
ensure
-
singleton_context_hooks_host.run_after_context_hooks(example_group_instance)
-
end
-
-
def run_after_example
-
assign_generated_description if defined?(::RSpec::Matchers)
-
hooks.run(:after, :example, self)
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/example.rb
in
- block in with_around_example_hooks
-
-
def hooks
-
example_group_instance.singleton_class.hooks
-
end
-
-
def with_around_example_hooks
-
RSpec.current_scope = :before_example_hook
-
hooks.run(:around, :example, self) { yield }
rescue Support::AllExceptionsExceptOnesWeMustNotRescue => e
-
set_exception(e)
-
end
-
-
def start(reporter)
-
reporter.example_started(self)
-
execution_result.started_at = clock.now
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/hooks.rb
in
- block in run
- unless example_or_group.class.metadata[:skip]
-
run_owned_hooks_for(position, :context, example_or_group)
-
end
-
else
-
case position
-
when :before then run_example_hooks_for(example_or_group, :before, :reverse_each)
-
when :after then run_example_hooks_for(example_or_group, :after, :each)
-
when :around then run_around_example_hooks_for(example_or_group) { yield }
end
-
end
-
end
-
-
SCOPES = [:example, :context]
-
-
SCOPE_ALIASES = { :each => :example, :all => :context }
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/hooks.rb
in
- block in run_around_example_hooks_for
- def run_around_example_hooks_for(example)
-
hooks = FlatMap.flat_map(owner_parent_groups) do |group|
-
group.hooks.matching_hooks_for(:around, :example, example)
-
end
-
-
return yield if hooks.empty? # exit early to avoid the extra allocation cost of `Example::Procsy`
-
-
initial_procsy = Example::Procsy.new(example) { yield }
hooks.inject(initial_procsy) do |procsy, around_hook|
-
procsy.wrap { around_hook.execute_with(example, procsy) }
-
end.call
-
end
-
-
if respond_to?(:singleton_class) && singleton_class.ancestors.include?(singleton_class)
-
def owner_parent_groups
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/example.rb
in
- call
-
-
define_method(name) { |*a, &b| @proc.__send__(name, *a, &b) }
-
end
-
-
# Calls the proc and notes that the example has been executed.
-
def call(*args, &block)
-
@executed = true
-
@proc.call(*args, &block)
end
-
alias run call
-
-
# Provides a wrapped proc that will update our `executed?` state when
-
# executed.
-
def to_proc
-
method(:call).to_proc
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/webmock-3.23.1/lib/webmock/rspec.rb
in
- block (2 levels) in <top (required)>
- end
-
-
config.after(:suite) do
-
WebMock.disable!
-
end
-
-
config.around(:each) do |example|
-
example.run
WebMock.reset!
-
end
-
}
-
-
WebMock::AssertionFailure.error_class = RSPEC_NAMESPACE::Expectations::ExpectationNotMetError
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/example.rb
in
- instance_exec
- start(reporter)
-
Pending.mark_skipped! self, exception.argument
-
finish(reporter)
-
end
-
-
# @private
-
def instance_exec(*args, &block)
-
@example_group_instance.instance_exec(*args, &block)
end
-
-
private
-
-
def hooks
-
example_group_instance.singleton_class.hooks
-
end
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/example.rb
in
- instance_exec
- start(reporter)
-
Pending.mark_skipped! self, exception.argument
-
finish(reporter)
-
end
-
-
# @private
-
def instance_exec(*args, &block)
-
@example_group_instance.instance_exec(*args, &block)
end
-
-
private
-
-
def hooks
-
example_group_instance.singleton_class.hooks
-
end
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/hooks.rb
in
- execute_with
- RSpec.configuration.reporter.notify_non_example_exception(e, "An error occurred in an `after(:context)` hook.")
-
end
-
end
-
-
# @private
-
class AroundHook < Hook
-
def execute_with(example, procsy)
-
example.instance_exec(procsy, &block)
return if procsy.executed?
-
Pending.mark_skipped!(example,
-
"#{hook_description} did not execute the example")
-
end
-
-
if Proc.method_defined?(:source_location)
-
def hook_description
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/hooks.rb
in
- block (2 levels) in run_around_example_hooks_for
- group.hooks.matching_hooks_for(:around, :example, example)
-
end
-
-
return yield if hooks.empty? # exit early to avoid the extra allocation cost of `Example::Procsy`
-
-
initial_procsy = Example::Procsy.new(example) { yield }
-
hooks.inject(initial_procsy) do |procsy, around_hook|
-
procsy.wrap { around_hook.execute_with(example, procsy) }
end.call
-
end
-
-
if respond_to?(:singleton_class) && singleton_class.ancestors.include?(singleton_class)
-
def owner_parent_groups
-
@owner.parent_groups
-
end
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/example.rb
in
- call
-
-
define_method(name) { |*a, &b| @proc.__send__(name, *a, &b) }
-
end
-
-
# Calls the proc and notes that the example has been executed.
-
def call(*args, &block)
-
@executed = true
-
@proc.call(*args, &block)
end
-
alias run call
-
-
# Provides a wrapped proc that will update our `executed?` state when
-
# executed.
-
def to_proc
-
method(:call).to_proc
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/hooks.rb
in
- run_around_example_hooks_for
- end
-
-
return yield if hooks.empty? # exit early to avoid the extra allocation cost of `Example::Procsy`
-
-
initial_procsy = Example::Procsy.new(example) { yield }
-
hooks.inject(initial_procsy) do |procsy, around_hook|
-
procsy.wrap { around_hook.execute_with(example, procsy) }
-
end.call
end
-
-
if respond_to?(:singleton_class) && singleton_class.ancestors.include?(singleton_class)
-
def owner_parent_groups
-
@owner.parent_groups
-
end
-
else # Ruby < 2.1 (see https://bugs.ruby-lang.org/issues/8035)
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/hooks.rb
in
- run
- unless example_or_group.class.metadata[:skip]
-
run_owned_hooks_for(position, :context, example_or_group)
-
end
-
else
-
case position
-
when :before then run_example_hooks_for(example_or_group, :before, :reverse_each)
-
when :after then run_example_hooks_for(example_or_group, :after, :each)
-
when :around then run_around_example_hooks_for(example_or_group) { yield }
end
-
end
-
end
-
-
SCOPES = [:example, :context]
-
-
SCOPE_ALIASES = { :each => :example, :all => :context }
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/example.rb
in
- with_around_example_hooks
-
-
def hooks
-
example_group_instance.singleton_class.hooks
-
end
-
-
def with_around_example_hooks
-
RSpec.current_scope = :before_example_hook
-
hooks.run(:around, :example, self) { yield }
rescue Support::AllExceptionsExceptOnesWeMustNotRescue => e
-
set_exception(e)
-
end
-
-
def start(reporter)
-
reporter.example_started(self)
-
execution_result.started_at = clock.now
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/example.rb
in
- with_around_and_singleton_context_hooks
- @example_group_instance.setup_mocks_for_rspec
-
hooks.run(:before, :example, self)
-
end
-
-
def with_around_and_singleton_context_hooks
-
singleton_context_hooks_host = example_group_instance.singleton_class
-
singleton_context_hooks_host.run_before_context_hooks(example_group_instance)
-
with_around_example_hooks { yield }
ensure
-
singleton_context_hooks_host.run_after_context_hooks(example_group_instance)
-
end
-
-
def run_after_example
-
assign_generated_description if defined?(::RSpec::Matchers)
-
hooks.run(:after, :example, self)
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/example.rb
in
- run
- start(reporter)
-
Pending.mark_pending!(self, pending) if pending?
-
-
begin
-
if skipped?
-
Pending.mark_pending! self, skip
-
elsif !RSpec.configuration.dry_run?
-
with_around_and_singleton_context_hooks do
begin
-
run_before_example
-
RSpec.current_scope = :example
-
@example_group_instance.instance_exec(self, &@example_block)
-
-
if pending?
-
Pending.mark_fixed! self
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/example_group.rb
in
- block in run_examples
-
-
# @private
-
def self.run_examples(reporter)
-
ordering_strategy.order(filtered_examples).map do |example|
-
next if RSpec.world.wants_to_quit
-
instance = new(example.inspect_output)
-
set_ivars(instance, before_context_ivars)
-
succeeded = example.run(instance, reporter)
if !succeeded && reporter.fail_fast_limit_met?
-
RSpec.world.wants_to_quit = true
-
end
-
succeeded
-
end.all?
-
end
-
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/example_group.rb
in
- map
-
-
registry.fetch(:global)
-
end
-
end
-
-
# @private
-
def self.run_examples(reporter)
-
ordering_strategy.order(filtered_examples).map do |example|
next if RSpec.world.wants_to_quit
-
instance = new(example.inspect_output)
-
set_ivars(instance, before_context_ivars)
-
succeeded = example.run(instance, reporter)
-
if !succeeded && reporter.fail_fast_limit_met?
-
RSpec.world.wants_to_quit = true
-
end
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/example_group.rb
in
- run_examples
-
-
registry.fetch(:global)
-
end
-
end
-
-
# @private
-
def self.run_examples(reporter)
-
ordering_strategy.order(filtered_examples).map do |example|
next if RSpec.world.wants_to_quit
-
instance = new(example.inspect_output)
-
set_ivars(instance, before_context_ivars)
-
succeeded = example.run(instance, reporter)
-
if !succeeded && reporter.fail_fast_limit_met?
-
RSpec.world.wants_to_quit = true
-
end
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/example_group.rb
in
- run
- return if RSpec.world.wants_to_quit
-
reporter.example_group_started(self)
-
-
should_run_context_hooks = descendant_filtered_examples.any?
-
begin
-
RSpec.current_scope = :before_context_hook
-
run_before_context_hooks(new('before(:context) hook')) if should_run_context_hooks
-
result_for_this_group = run_examples(reporter)
results_for_descendants = ordering_strategy.order(children).map { |child| child.run(reporter) }.all?
-
result_for_this_group && results_for_descendants
-
rescue Pending::SkipDeclaredInExample => ex
-
for_filtered_examples(reporter) { |example| example.skip_with_exception(reporter, ex) }
-
true
-
rescue Support::AllExceptionsExceptOnesWeMustNotRescue => ex
-
for_filtered_examples(reporter) { |example| example.fail_with_exception(reporter, ex) }
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/example_group.rb
in
- block in run
- reporter.example_group_started(self)
-
-
should_run_context_hooks = descendant_filtered_examples.any?
-
begin
-
RSpec.current_scope = :before_context_hook
-
run_before_context_hooks(new('before(:context) hook')) if should_run_context_hooks
-
result_for_this_group = run_examples(reporter)
-
results_for_descendants = ordering_strategy.order(children).map { |child| child.run(reporter) }.all?
result_for_this_group && results_for_descendants
-
rescue Pending::SkipDeclaredInExample => ex
-
for_filtered_examples(reporter) { |example| example.skip_with_exception(reporter, ex) }
-
true
-
rescue Support::AllExceptionsExceptOnesWeMustNotRescue => ex
-
for_filtered_examples(reporter) { |example| example.fail_with_exception(reporter, ex) }
-
RSpec.world.wants_to_quit = true if reporter.fail_fast_limit_met?
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/example_group.rb
in
- map
- reporter.example_group_started(self)
-
-
should_run_context_hooks = descendant_filtered_examples.any?
-
begin
-
RSpec.current_scope = :before_context_hook
-
run_before_context_hooks(new('before(:context) hook')) if should_run_context_hooks
-
result_for_this_group = run_examples(reporter)
-
results_for_descendants = ordering_strategy.order(children).map { |child| child.run(reporter) }.all?
result_for_this_group && results_for_descendants
-
rescue Pending::SkipDeclaredInExample => ex
-
for_filtered_examples(reporter) { |example| example.skip_with_exception(reporter, ex) }
-
true
-
rescue Support::AllExceptionsExceptOnesWeMustNotRescue => ex
-
for_filtered_examples(reporter) { |example| example.fail_with_exception(reporter, ex) }
-
RSpec.world.wants_to_quit = true if reporter.fail_fast_limit_met?
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/example_group.rb
in
- run
- reporter.example_group_started(self)
-
-
should_run_context_hooks = descendant_filtered_examples.any?
-
begin
-
RSpec.current_scope = :before_context_hook
-
run_before_context_hooks(new('before(:context) hook')) if should_run_context_hooks
-
result_for_this_group = run_examples(reporter)
-
results_for_descendants = ordering_strategy.order(children).map { |child| child.run(reporter) }.all?
result_for_this_group && results_for_descendants
-
rescue Pending::SkipDeclaredInExample => ex
-
for_filtered_examples(reporter) { |example| example.skip_with_exception(reporter, ex) }
-
true
-
rescue Support::AllExceptionsExceptOnesWeMustNotRescue => ex
-
for_filtered_examples(reporter) { |example| example.fail_with_exception(reporter, ex) }
-
RSpec.world.wants_to_quit = true if reporter.fail_fast_limit_met?
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/runner.rb
in
- block (3 levels) in run_specs
- examples_count = @world.example_count(example_groups)
-
examples_passed = @configuration.reporter.report(examples_count) do |reporter|
-
@configuration.with_suite_hooks do
-
if examples_count == 0 && @configuration.fail_if_no_examples
-
return @configuration.failure_exit_code
-
end
-
-
example_groups.map { |g| g.run(reporter) }.all?
end
-
end
-
-
exit_code(examples_passed)
-
end
-
-
# @private
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/runner.rb
in
- map
- examples_count = @world.example_count(example_groups)
-
examples_passed = @configuration.reporter.report(examples_count) do |reporter|
-
@configuration.with_suite_hooks do
-
if examples_count == 0 && @configuration.fail_if_no_examples
-
return @configuration.failure_exit_code
-
end
-
-
example_groups.map { |g| g.run(reporter) }.all?
end
-
end
-
-
exit_code(examples_passed)
-
end
-
-
# @private
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/runner.rb
in
- block (2 levels) in run_specs
- examples_count = @world.example_count(example_groups)
-
examples_passed = @configuration.reporter.report(examples_count) do |reporter|
-
@configuration.with_suite_hooks do
-
if examples_count == 0 && @configuration.fail_if_no_examples
-
return @configuration.failure_exit_code
-
end
-
-
example_groups.map { |g| g.run(reporter) }.all?
end
-
end
-
-
exit_code(examples_passed)
-
end
-
-
# @private
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/configuration.rb
in
- with_suite_hooks
- # @private
-
def with_suite_hooks
-
return yield if dry_run?
-
-
begin
-
RSpec.current_scope = :before_suite_hook
-
run_suite_hooks("a `before(:suite)` hook", @before_suite_hooks)
-
yield
ensure
-
RSpec.current_scope = :after_suite_hook
-
run_suite_hooks("an `after(:suite)` hook", @after_suite_hooks)
-
RSpec.current_scope = :suite
-
end
-
end
-
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/runner.rb
in
- block in run_specs
- # @param example_groups [Array<RSpec::Core::ExampleGroup>] groups to run
-
# @return [Fixnum] exit status code. 0 if all specs passed,
-
# or the configured failure exit code (1 by default) if specs
-
# failed.
-
def run_specs(example_groups)
-
examples_count = @world.example_count(example_groups)
-
examples_passed = @configuration.reporter.report(examples_count) do |reporter|
-
@configuration.with_suite_hooks do
if examples_count == 0 && @configuration.fail_if_no_examples
-
return @configuration.failure_exit_code
-
end
-
-
example_groups.map { |g| g.run(reporter) }.all?
-
end
-
end
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/reporter.rb
in
- report
- # reporter.report(group.examples.size) do |r|
-
# example_groups.map {|g| g.run(r) }
-
# end
-
#
-
def report(expected_example_count)
-
start(expected_example_count)
-
begin
-
yield self
ensure
-
finish
-
end
-
end
-
-
# @param exit_code [Integer] the exit_code to be return by the reporter
-
#
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/runner.rb
in
- run_specs
- #
-
# @param example_groups [Array<RSpec::Core::ExampleGroup>] groups to run
-
# @return [Fixnum] exit status code. 0 if all specs passed,
-
# or the configured failure exit code (1 by default) if specs
-
# failed.
-
def run_specs(example_groups)
-
examples_count = @world.example_count(example_groups)
-
examples_passed = @configuration.reporter.report(examples_count) do |reporter|
@configuration.with_suite_hooks do
-
if examples_count == 0 && @configuration.fail_if_no_examples
-
return @configuration.failure_exit_code
-
end
-
-
example_groups.map { |g| g.run(reporter) }.all?
-
end
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/runner.rb
in
- run
- #
-
# @param err [IO] error stream
-
# @param out [IO] output stream
-
def run(err, out)
-
setup(err, out)
-
return @configuration.reporter.exit_early(exit_code) if RSpec.world.wants_to_quit
-
-
run_specs(@world.ordered_example_groups).tap do
persist_example_statuses
-
end
-
end
-
-
# Wires together the various configuration objects and state holders.
-
#
-
# @param err [IO] error stream
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/runner.rb
in
- run
- def self.run(args, err=$stderr, out=$stdout)
-
trap_interrupt
-
options = ConfigurationOptions.new(args)
-
-
if options.options[:runner]
-
options.options[:runner].call(options, err, out)
-
else
-
new(options).run(err, out)
end
-
end
-
-
def initialize(options, configuration=RSpec.configuration, world=RSpec.world)
-
@options = options
-
@configuration = configuration
-
@world = world
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/lib/rspec/core/runner.rb
in
- invoke
- invoke
-
end
-
-
# Runs the suite of specs and exits the process with an appropriate exit
-
# code.
-
def self.invoke
-
disable_autorun!
-
status = run(ARGV, $stderr, $stdout).to_i
exit(status) if status != 0
-
end
-
-
# Run a suite of RSpec examples. Does not exit.
-
#
-
# This is used internally by RSpec to run a suite, but is available
-
# for use by any other automation tool.
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/rspec-core-3.13.0/exe/rspec
in
- <top (required)>
- #!/usr/bin/env ruby
-
-
require 'rspec/core'
-
RSpec::Core::Runner.invoke
/Users/barryhalper/.rvm/gems/ruby-3.3.4/bin/rspec
in
- load
- if str and Gem::Version.correct?(str)
-
version = str
-
ARGV.shift
-
end
-
end
-
-
if Gem.respond_to?(:activate_bin_path)
-
load Gem.activate_bin_path('rspec-core', 'rspec', version)
else
-
gem "rspec-core", version
-
load Gem.bin_path("rspec-core", "rspec", version)
-
end
-
/Users/barryhalper/.rvm/gems/ruby-3.3.4/bin/rspec
in
- <main>
- if str and Gem::Version.correct?(str)
-
version = str
-
ARGV.shift
-
end
-
end
-
-
if Gem.respond_to?(:activate_bin_path)
-
load Gem.activate_bin_path('rspec-core', 'rspec', version)
else
-
gem "rspec-core", version
-
load Gem.bin_path("rspec-core", "rspec", version)
-
end
-
Variable | -Value | -
---|---|
country | -"northern-ireland" |
-
No POST data.
- - -Variable | -Value | -
---|---|
HTTPS | -off |
-
HTTP_COOKIE | -- |
HTTP_HOST | -find-energy-certificate.epb-frontend |
-
PATH_INFO | -/service-performance/download-csv |
-
QUERY_STRING | -country=northern-ireland |
-
REMOTE_ADDR | -127.0.0.1 |
-
REQUEST_METHOD | -GET |
-
SCRIPT_NAME | -- |
SERVER_NAME | -find-energy-certificate.epb-frontend |
-
SERVER_PORT | -80 |
-
SERVER_PROTOCOL | -HTTP/1.0 |
-
rack.errors | -#<Object:0x000000012d61bec0> |
-
rack.logger | -#<Rack::NullLogger:0x000000012dadbd20 @app=#<Rack::Protection::FrameOptions:0x000000012dadbe10 @app=#<Rack::Protection::HttpOrigin:0x000000012dadbf00 @app=#<Rack::Protection::IPSpoofing:0x000000012dadbff0 @app=#<Rack::Protection::JsonCsrf:0x000000012dadc0e0 @app=#<Rack::Protection::PathTraversal:0x000000012dadc1d0 @app=#<Rack::Protection::XSSHeader:0x000000012dadc310 @app=#<FrontendService:0x000000012cf7b908 @default_layout=:layout, @preferred_extension=nil, @app=nil, @template_cache=#<Sinatra::TemplateCache:0x000000012de56ea0 @cache={}>, @pinned_response=nil, @toggles=Helper::Toggles, @container=#<Container:0x000000012de56a90 @objects={:internal_api_client=>#<Auth::HttpClient:0x000000012de56900 @authenticated_client=#<OAuth2::AccessToken:0x00000001287b4a70 @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>, @token="abc", @refresh_token=nil, @expires_in=3600, @expires_at=1726824080, @expires_latency=nil, @options={:mode=>:header, :header_format=>"Bearer %s", :param_name=>"access_token"}, @params=#<SnakyHash::StringKeyed token_type="bearer">, @response=#<OAuth2::Response:0x000000012d6d7f08 @response=#<Faraday::Response:0x000000012dad1550 @on_complete_callbacks=[], @env=#<Faraday::Env @method=:post @request_body="client_id=test.id&client_secret=test.client.secret&grant_type=client_credentials" @url=#<URI::HTTP http://test-auth-server.gov.uk/oauth/token> @request=#<Faraday::RequestOptions timeout=8> @request_headers={"User-Agent"=>"Faraday v2.10.1", "Content-Type"=>"application/x-www-form-urlencoded"} @ssl=#<Faraday::SSLOptions (empty)> @response=#<Faraday::Response:0x000000012dad1550 ...> @response_headers={"content-type"=>"application/json"} @status=200 @reason_phrase="" @response_body="{\"access_token\":\"abc\",\"expires_in\":3600,\"token_type\":\"bearer\"}">>, @options={:parse=>:automatic, :snaky=>true}, @parser=#<Proc:0x000000012c1cdb08 /Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/oauth2-2.0.9/lib/oauth2/response.rb:142>, @parsed=#<SnakyHash::StringKeyed access_token="abc" expires_in=3600 token_type="bearer">>>, @base_uri="http://test-api.gov.uk", @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>>, :internal_data_warehouse_api_client=>#<Auth::HttpClient:0x000000012de56388 @authenticated_client=#<OAuth2::AccessToken:0x000000012daba148 @client=#<OAuth2::Client:0x000000012cf7b278 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b228 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de56180 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b1d8 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56158>, @mon_data_owner_object_id=5780>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012d633908 @client=#<OAuth2::Client:0x000000012cf7b278 ...>>, @connection=#<Faraday::Connection:0x0000000104c5d708 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012d6335c0 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012cf997a0 @app=#<Faraday::Adapter::NetHttp:0x000000012cf7ff58 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>, @token="abc", @refresh_token=nil, @expires_in=3600, @expires_at=1726824080, @expires_latency=nil, @options={:mode=>:header, :header_format=>"Bearer %s", :param_name=>"access_token"}, @params=#<SnakyHash::StringKeyed token_type="bearer">, @response=#<OAuth2::Response:0x000000012cf787a8 @response=#<Faraday::Response:0x000000012cf93e68 @on_complete_callbacks=[], @env=#<Faraday::Env @method=:post @request_body="client_id=test.id&client_secret=test.client.secret&grant_type=client_credentials" @url=#<URI::HTTP http://test-auth-server.gov.uk/oauth/token> @request=#<Faraday::RequestOptions timeout=8> @request_headers={"User-Agent"=>"Faraday v2.10.1", "Content-Type"=>"application/x-www-form-urlencoded"} @ssl=#<Faraday::SSLOptions (empty)> @response=#<Faraday::Response:0x000000012cf93e68 ...> @response_headers={"content-type"=>"application/json"} @status=200 @reason_phrase="" @response_body="{\"access_token\":\"abc\",\"expires_in\":3600,\"token_type\":\"bearer\"}">>, @options={:parse=>:automatic, :snaky=>true}, @parser=#<Proc:0x000000012c1cdb08 /Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/oauth2-2.0.9/lib/oauth2/response.rb:142>, @parsed=#<SnakyHash::StringKeyed access_token="abc" expires_in=3600 token_type="bearer">>>, @base_uri="http://epb-data-warehouse-api", @client=#<OAuth2::Client:0x000000012cf7b278 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b228 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de56180 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b1d8 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56158>, @mon_data_owner_object_id=5780>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012d633908 @client=#<OAuth2::Client:0x000000012cf7b278 ...>>, @connection=#<Faraday::Connection:0x0000000104c5d708 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012d6335c0 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012cf997a0 @app=#<Faraday::Adapter::NetHttp:0x000000012cf7ff58 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>>, :find_assessor_by_postcode_use_case=>#<UseCase::FindAssessorByPostcode:0x000000012dc7ead8 @gateway=#<Gateway::AssessorsGateway:0x000000012de54510 @internal_api_client=#<Auth::HttpClient:0x000000012de56900 @authenticated_client=#<OAuth2::AccessToken:0x00000001287b4a70 @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>, @token="abc", @refresh_token=nil, @expires_in=3600, @expires_at=1726824080, @expires_latency=nil, @options={:mode=>:header, :header_format=>"Bearer %s", :param_name=>"access_token"}, @params=#<SnakyHash::StringKeyed token_type="bearer">, @response=#<OAuth2::Response:0x000000012d6d7f08 @response=#<Faraday::Response:0x000000012dad1550 @on_complete_callbacks=[], @env=#<Faraday::Env @method=:post @request_body="client_id=test.id&client_secret=test.client.secret&grant_type=client_credentials" @url=#<URI::HTTP http://test-auth-server.gov.uk/oauth/token> @request=#<Faraday::RequestOptions timeout=8> @request_headers={"User-Agent"=>"Faraday v2.10.1", "Content-Type"=>"application/x-www-form-urlencoded"} @ssl=#<Faraday::SSLOptions (empty)> @response=#<Faraday::Response:0x000000012dad1550 ...> @response_headers={"content-type"=>"application/json"} @status=200 @reason_phrase="" @response_body="{\"access_token\":\"abc\",\"expires_in\":3600,\"token_type\":\"bearer\"}">>, @options={:parse=>:automatic, :snaky=>true}, @parser=#<Proc:0x000000012c1cdb08 /Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/oauth2-2.0.9/lib/oauth2/response.rb:142>, @parsed=#<SnakyHash::StringKeyed access_token="abc" expires_in=3600 token_type="bearer">>>, @base_uri="http://test-api.gov.uk", @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>>>>, :find_non_domestic_assessor_by_postcode_use_case=>#<UseCase::FindNonDomesticAssessorByPostcode:0x000000012dc7e240 @gateway=#<Gateway::AssessorsGateway:0x000000012de54510 @internal_api_client=#<Auth::HttpClient:0x000000012de56900 @authenticated_client=#<OAuth2::AccessToken:0x00000001287b4a70 @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>, @token="abc", @refresh_token=nil, @expires_in=3600, @expires_at=1726824080, @expires_latency=nil, @options={:mode=>:header, :header_format=>"Bearer %s", :param_name=>"access_token"}, @params=#<SnakyHash::StringKeyed token_type="bearer">, @response=#<OAuth2::Response:0x000000012d6d7f08 @response=#<Faraday::Response:0x000000012dad1550 @on_complete_callbacks=[], @env=#<Faraday::Env @method=:post @request_body="client_id=test.id&client_secret=test.client.secret&grant_type=client_credentials" @url=#<URI::HTTP http://test-auth-server.gov.uk/oauth/token> @request=#<Faraday::RequestOptions timeout=8> @request_headers={"User-Agent"=>"Faraday v2.10.1", "Content-Type"=>"application/x-www-form-urlencoded"} @ssl=#<Faraday::SSLOptions (empty)> @response=#<Faraday::Response:0x000000012dad1550 ...> @response_headers={"content-type"=>"application/json"} @status=200 @reason_phrase="" @response_body="{\"access_token\":\"abc\",\"expires_in\":3600,\"token_type\":\"bearer\"}">>, @options={:parse=>:automatic, :snaky=>true}, @parser=#<Proc:0x000000012c1cdb08 /Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/oauth2-2.0.9/lib/oauth2/response.rb:142>, @parsed=#<SnakyHash::StringKeyed access_token="abc" expires_in=3600 token_type="bearer">>>, @base_uri="http://test-api.gov.uk", @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>>>>, :find_assessor_by_name_use_case=>#<UseCase::FindAssessorByName:0x000000012dc7da20 @gateway=#<Gateway::AssessorsGateway:0x000000012de54510 @internal_api_client=#<Auth::HttpClient:0x000000012de56900 @authenticated_client=#<OAuth2::AccessToken:0x00000001287b4a70 @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>, @token="abc", @refresh_token=nil, @expires_in=3600, @expires_at=1726824080, @expires_latency=nil, @options={:mode=>:header, :header_format=>"Bearer %s", :param_name=>"access_token"}, @params=#<SnakyHash::StringKeyed token_type="bearer">, @response=#<OAuth2::Response:0x000000012d6d7f08 @response=#<Faraday::Response:0x000000012dad1550 @on_complete_callbacks=[], @env=#<Faraday::Env @method=:post @request_body="client_id=test.id&client_secret=test.client.secret&grant_type=client_credentials" @url=#<URI::HTTP http://test-auth-server.gov.uk/oauth/token> @request=#<Faraday::RequestOptions timeout=8> @request_headers={"User-Agent"=>"Faraday v2.10.1", "Content-Type"=>"application/x-www-form-urlencoded"} @ssl=#<Faraday::SSLOptions (empty)> @response=#<Faraday::Response:0x000000012dad1550 ...> @response_headers={"content-type"=>"application/json"} @status=200 @reason_phrase="" @response_body="{\"access_token\":\"abc\",\"expires_in\":3600,\"token_type\":\"bearer\"}">>, @options={:parse=>:automatic, :snaky=>true}, @parser=#<Proc:0x000000012c1cdb08 /Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/oauth2-2.0.9/lib/oauth2/response.rb:142>, @parsed=#<SnakyHash::StringKeyed access_token="abc" expires_in=3600 token_type="bearer">>>, @base_uri="http://test-api.gov.uk", @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>>>>, :fetch_certificate_use_case=>#<UseCase::FetchCertificate:0x000000012dc7b9f0 @gateway=#<Gateway::AssessmentSummaryGateway:0x000000012de52378 @internal_api_client=#<Auth::HttpClient:0x000000012de56900 @authenticated_client=#<OAuth2::AccessToken:0x00000001287b4a70 @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>, @token="abc", @refresh_token=nil, @expires_in=3600, @expires_at=1726824080, @expires_latency=nil, @options={:mode=>:header, :header_format=>"Bearer %s", :param_name=>"access_token"}, @params=#<SnakyHash::StringKeyed token_type="bearer">, @response=#<OAuth2::Response:0x000000012d6d7f08 @response=#<Faraday::Response:0x000000012dad1550 @on_complete_callbacks=[], @env=#<Faraday::Env @method=:post @request_body="client_id=test.id&client_secret=test.client.secret&grant_type=client_credentials" @url=#<URI::HTTP http://test-auth-server.gov.uk/oauth/token> @request=#<Faraday::RequestOptions timeout=8> @request_headers={"User-Agent"=>"Faraday v2.10.1", "Content-Type"=>"application/x-www-form-urlencoded"} @ssl=#<Faraday::SSLOptions (empty)> @response=#<Faraday::Response:0x000000012dad1550 ...> @response_headers={"content-type"=>"application/json"} @status=200 @reason_phrase="" @response_body="{\"access_token\":\"abc\",\"expires_in\":3600,\"token_type\":\"bearer\"}">>, @options={:parse=>:automatic, :snaky=>true}, @parser=#<Proc:0x000000012c1cdb08 /Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/oauth2-2.0.9/lib/oauth2/response.rb:142>, @parsed=#<SnakyHash::StringKeyed access_token="abc" expires_in=3600 token_type="bearer">>>, @base_uri="http://test-api.gov.uk", @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>>>>, :find_certificate_by_postcode_use_case=>#<UseCase::FindCertificateByPostcode:0x000000012dc7d098 @gateway=#<Gateway::CertificatesGateway:0x000000012de530e8 @internal_api_client=#<Auth::HttpClient:0x000000012de56900 @authenticated_client=#<OAuth2::AccessToken:0x00000001287b4a70 @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>, @token="abc", @refresh_token=nil, @expires_in=3600, @expires_at=1726824080, @expires_latency=nil, @options={:mode=>:header, :header_format=>"Bearer %s", :param_name=>"access_token"}, @params=#<SnakyHash::StringKeyed token_type="bearer">, @response=#<OAuth2::Response:0x000000012d6d7f08 @response=#<Faraday::Response:0x000000012dad1550 @on_complete_callbacks=[], @env=#<Faraday::Env @method=:post @request_body="client_id=test.id&client_secret=test.client.secret&grant_type=client_credentials" @url=#<URI::HTTP http://test-auth-server.gov.uk/oauth/token> @request=#<Faraday::RequestOptions timeout=8> @request_headers={"User-Agent"=>"Faraday v2.10.1", "Content-Type"=>"application/x-www-form-urlencoded"} @ssl=#<Faraday::SSLOptions (empty)> @response=#<Faraday::Response:0x000000012dad1550 ...> @response_headers={"content-type"=>"application/json"} @status=200 @reason_phrase="" @response_body="{\"access_token\":\"abc\",\"expires_in\":3600,\"token_type\":\"bearer\"}">>, @options={:parse=>:automatic, :snaky=>true}, @parser=#<Proc:0x000000012c1cdb08 /Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/oauth2-2.0.9/lib/oauth2/response.rb:142>, @parsed=#<SnakyHash::StringKeyed access_token="abc" expires_in=3600 token_type="bearer">>>, @base_uri="http://test-api.gov.uk", @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>>>>, :find_certificate_by_id_use_case=>#<UseCase::FindCertificateById:0x000000012dc7c4b8 @gateway=#<Gateway::CertificatesGateway:0x000000012de530e8 @internal_api_client=#<Auth::HttpClient:0x000000012de56900 @authenticated_client=#<OAuth2::AccessToken:0x00000001287b4a70 @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>, @token="abc", @refresh_token=nil, @expires_in=3600, @expires_at=1726824080, @expires_latency=nil, @options={:mode=>:header, :header_format=>"Bearer %s", :param_name=>"access_token"}, @params=#<SnakyHash::StringKeyed token_type="bearer">, @response=#<OAuth2::Response:0x000000012d6d7f08 @response=#<Faraday::Response:0x000000012dad1550 @on_complete_callbacks=[], @env=#<Faraday::Env @method=:post @request_body="client_id=test.id&client_secret=test.client.secret&grant_type=client_credentials" @url=#<URI::HTTP http://test-auth-server.gov.uk/oauth/token> @request=#<Faraday::RequestOptions timeout=8> @request_headers={"User-Agent"=>"Faraday v2.10.1", "Content-Type"=>"application/x-www-form-urlencoded"} @ssl=#<Faraday::SSLOptions (empty)> @response=#<Faraday::Response:0x000000012dad1550 ...> @response_headers={"content-type"=>"application/json"} @status=200 @reason_phrase="" @response_body="{\"access_token\":\"abc\",\"expires_in\":3600,\"token_type\":\"bearer\"}">>, @options={:parse=>:automatic, :snaky=>true}, @parser=#<Proc:0x000000012c1cdb08 /Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/oauth2-2.0.9/lib/oauth2/response.rb:142>, @parsed=#<SnakyHash::StringKeyed access_token="abc" expires_in=3600 token_type="bearer">>>, @base_uri="http://test-api.gov.uk", @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>>>>, :find_certificate_by_street_name_and_town_use_case=>#<UseCase::FindCertificateByStreetNameAndTown:0x000000012dc7ae38 @gateway=#<Gateway::CertificatesGateway:0x000000012de530e8 @internal_api_client=#<Auth::HttpClient:0x000000012de56900 @authenticated_client=#<OAuth2::AccessToken:0x00000001287b4a70 @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>, @token="abc", @refresh_token=nil, @expires_in=3600, @expires_at=1726824080, @expires_latency=nil, @options={:mode=>:header, :header_format=>"Bearer %s", :param_name=>"access_token"}, @params=#<SnakyHash::StringKeyed token_type="bearer">, @response=#<OAuth2::Response:0x000000012d6d7f08 @response=#<Faraday::Response:0x000000012dad1550 @on_complete_callbacks=[], @env=#<Faraday::Env @method=:post @request_body="client_id=test.id&client_secret=test.client.secret&grant_type=client_credentials" @url=#<URI::HTTP http://test-auth-server.gov.uk/oauth/token> @request=#<Faraday::RequestOptions timeout=8> @request_headers={"User-Agent"=>"Faraday v2.10.1", "Content-Type"=>"application/x-www-form-urlencoded"} @ssl=#<Faraday::SSLOptions (empty)> @response=#<Faraday::Response:0x000000012dad1550 ...> @response_headers={"content-type"=>"application/json"} @status=200 @reason_phrase="" @response_body="{\"access_token\":\"abc\",\"expires_in\":3600,\"token_type\":\"bearer\"}">>, @options={:parse=>:automatic, :snaky=>true}, @parser=#<Proc:0x000000012c1cdb08 /Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/oauth2-2.0.9/lib/oauth2/response.rb:142>, @parsed=#<SnakyHash::StringKeyed access_token="abc" expires_in=3600 token_type="bearer">>>, @base_uri="http://test-api.gov.uk", @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>>>>, :fetch_dec_summary_use_case=>#<UseCase::FetchDecSummary:0x000000012dc7a488 @gateway=#<Gateway::CertificatesGateway:0x000000012de530e8 @internal_api_client=#<Auth::HttpClient:0x000000012de56900 @authenticated_client=#<OAuth2::AccessToken:0x00000001287b4a70 @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>, @token="abc", @refresh_token=nil, @expires_in=3600, @expires_at=1726824080, @expires_latency=nil, @options={:mode=>:header, :header_format=>"Bearer %s", :param_name=>"access_token"}, @params=#<SnakyHash::StringKeyed token_type="bearer">, @response=#<OAuth2::Response:0x000000012d6d7f08 @response=#<Faraday::Response:0x000000012dad1550 @on_complete_callbacks=[], @env=#<Faraday::Env @method=:post @request_body="client_id=test.id&client_secret=test.client.secret&grant_type=client_credentials" @url=#<URI::HTTP http://test-auth-server.gov.uk/oauth/token> @request=#<Faraday::RequestOptions timeout=8> @request_headers={"User-Agent"=>"Faraday v2.10.1", "Content-Type"=>"application/x-www-form-urlencoded"} @ssl=#<Faraday::SSLOptions (empty)> @response=#<Faraday::Response:0x000000012dad1550 ...> @response_headers={"content-type"=>"application/json"} @status=200 @reason_phrase="" @response_body="{\"access_token\":\"abc\",\"expires_in\":3600,\"token_type\":\"bearer\"}">>, @options={:parse=>:automatic, :snaky=>true}, @parser=#<Proc:0x000000012c1cdb08 /Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/oauth2-2.0.9/lib/oauth2/response.rb:142>, @parsed=#<SnakyHash::StringKeyed access_token="abc" expires_in=3600 token_type="bearer">>>, @base_uri="http://test-api.gov.uk", @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>>>>, :fetch_statistics_use_case=>#<UseCase::FetchStatistics:0x000000012dc77e90 @statistics_gateway=#<Gateway::StatisticsGateway:0x000000012dc78c78 @internal_api_client=#<Auth::HttpClient:0x000000012de56900 @authenticated_client=#<OAuth2::AccessToken:0x00000001287b4a70 @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>, @token="abc", @refresh_token=nil, @expires_in=3600, @expires_at=1726824080, @expires_latency=nil, @options={:mode=>:header, :header_format=>"Bearer %s", :param_name=>"access_token"}, @params=#<SnakyHash::StringKeyed token_type="bearer">, @response=#<OAuth2::Response:0x000000012d6d7f08 @response=#<Faraday::Response:0x000000012dad1550 @on_complete_callbacks=[], @env=#<Faraday::Env @method=:post @request_body="client_id=test.id&client_secret=test.client.secret&grant_type=client_credentials" @url=#<URI::HTTP http://test-auth-server.gov.uk/oauth/token> @request=#<Faraday::RequestOptions timeout=8> @request_headers={"User-Agent"=>"Faraday v2.10.1", "Content-Type"=>"application/x-www-form-urlencoded"} @ssl=#<Faraday::SSLOptions (empty)> @response=#<Faraday::Response:0x000000012dad1550 ...> @response_headers={"content-type"=>"application/json"} @status=200 @reason_phrase="" @response_body="{\"access_token\":\"abc\",\"expires_in\":3600,\"token_type\":\"bearer\"}">>, @options={:parse=>:automatic, :snaky=>true}, @parser=#<Proc:0x000000012c1cdb08 /Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/oauth2-2.0.9/lib/oauth2/response.rb:142>, @parsed=#<SnakyHash::StringKeyed access_token="abc" expires_in=3600 token_type="bearer">>>, @base_uri="http://test-api.gov.uk", @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>>>, @co2_gateway=#<Gateway::AverageCo2EmissionsGateway:0x000000012dc77f08 @internal_api_client=#<Auth::HttpClient:0x000000012de56388 @authenticated_client=#<OAuth2::AccessToken:0x000000012daba148 @client=#<OAuth2::Client:0x000000012cf7b278 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b228 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de56180 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b1d8 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56158>, @mon_data_owner_object_id=5780>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012d633908 @client=#<OAuth2::Client:0x000000012cf7b278 ...>>, @connection=#<Faraday::Connection:0x0000000104c5d708 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012d6335c0 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012cf997a0 @app=#<Faraday::Adapter::NetHttp:0x000000012cf7ff58 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>, @token="abc", @refresh_token=nil, @expires_in=3600, @expires_at=1726824080, @expires_latency=nil, @options={:mode=>:header, :header_format=>"Bearer %s", :param_name=>"access_token"}, @params=#<SnakyHash::StringKeyed token_type="bearer">, @response=#<OAuth2::Response:0x000000012cf787a8 @response=#<Faraday::Response:0x000000012cf93e68 @on_complete_callbacks=[], @env=#<Faraday::Env @method=:post @request_body="client_id=test.id&client_secret=test.client.secret&grant_type=client_credentials" @url=#<URI::HTTP http://test-auth-server.gov.uk/oauth/token> @request=#<Faraday::RequestOptions timeout=8> @request_headers={"User-Agent"=>"Faraday v2.10.1", "Content-Type"=>"application/x-www-form-urlencoded"} @ssl=#<Faraday::SSLOptions (empty)> @response=#<Faraday::Response:0x000000012cf93e68 ...> @response_headers={"content-type"=>"application/json"} @status=200 @reason_phrase="" @response_body="{\"access_token\":\"abc\",\"expires_in\":3600,\"token_type\":\"bearer\"}">>, @options={:parse=>:automatic, :snaky=>true}, @parser=#<Proc:0x000000012c1cdb08 /Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/oauth2-2.0.9/lib/oauth2/response.rb:142>, @parsed=#<SnakyHash::StringKeyed access_token="abc" expires_in=3600 token_type="bearer">>>, @base_uri="http://epb-data-warehouse-api", @client=#<OAuth2::Client:0x000000012cf7b278 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b228 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de56180 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b1d8 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56158>, @mon_data_owner_object_id=5780>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012d633908 @client=#<OAuth2::Client:0x000000012cf7b278 ...>>, @connection=#<Faraday::Connection:0x0000000104c5d708 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012d6335c0 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012cf997a0 @app=#<Faraday::Adapter::NetHttp:0x000000012cf7ff58 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>>>>, :fetch_statistics_csv_use_case=>#<UseCase::FetchStatisticsCsv:0x000000012dc76d38 @statistics_gateway=#<Gateway::StatisticsGateway:0x000000012dc76dd8 @internal_api_client=#<Auth::HttpClient:0x000000012de56900 @authenticated_client=#<OAuth2::AccessToken:0x00000001287b4a70 @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>, @token="abc", @refresh_token=nil, @expires_in=3600, @expires_at=1726824080, @expires_latency=nil, @options={:mode=>:header, :header_format=>"Bearer %s", :param_name=>"access_token"}, @params=#<SnakyHash::StringKeyed token_type="bearer">, @response=#<OAuth2::Response:0x000000012d6d7f08 @response=#<Faraday::Response:0x000000012dad1550 @on_complete_callbacks=[], @env=#<Faraday::Env @method=:post @request_body="client_id=test.id&client_secret=test.client.secret&grant_type=client_credentials" @url=#<URI::HTTP http://test-auth-server.gov.uk/oauth/token> @request=#<Faraday::RequestOptions timeout=8> @request_headers={"User-Agent"=>"Faraday v2.10.1", "Content-Type"=>"application/x-www-form-urlencoded"} @ssl=#<Faraday::SSLOptions (empty)> @response=#<Faraday::Response:0x000000012dad1550 ...> @response_headers={"content-type"=>"application/json"} @status=200 @reason_phrase="" @response_body="{\"access_token\":\"abc\",\"expires_in\":3600,\"token_type\":\"bearer\"}">>, @options={:parse=>:automatic, :snaky=>true}, @parser=#<Proc:0x000000012c1cdb08 /Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/oauth2-2.0.9/lib/oauth2/response.rb:142>, @parsed=#<SnakyHash::StringKeyed access_token="abc" expires_in=3600 token_type="bearer">>>, @base_uri="http://test-api.gov.uk", @client=#<OAuth2::Client:0x000000012cf7b638 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b5e8 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de565e0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b598 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56590>, @mon_data_owner_object_id=5760>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012dad73b0 @client=#<OAuth2::Client:0x000000012cf7b638 ...>>, @connection=#<Faraday::Connection:0x00000001287f46c0 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012dad5f10 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012dad27e8 @app=#<Faraday::Adapter::NetHttp:0x00000001287f0f70 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>>>, @co2_gateway=#<Gateway::AverageCo2EmissionsGateway:0x000000012dc76d88 @internal_api_client=#<Auth::HttpClient:0x000000012de56388 @authenticated_client=#<OAuth2::AccessToken:0x000000012daba148 @client=#<OAuth2::Client:0x000000012cf7b278 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b228 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de56180 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b1d8 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56158>, @mon_data_owner_object_id=5780>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012d633908 @client=#<OAuth2::Client:0x000000012cf7b278 ...>>, @connection=#<Faraday::Connection:0x0000000104c5d708 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012d6335c0 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012cf997a0 @app=#<Faraday::Adapter::NetHttp:0x000000012cf7ff58 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>, @token="abc", @refresh_token=nil, @expires_in=3600, @expires_at=1726824080, @expires_latency=nil, @options={:mode=>:header, :header_format=>"Bearer %s", :param_name=>"access_token"}, @params=#<SnakyHash::StringKeyed token_type="bearer">, @response=#<OAuth2::Response:0x000000012cf787a8 @response=#<Faraday::Response:0x000000012cf93e68 @on_complete_callbacks=[], @env=#<Faraday::Env @method=:post @request_body="client_id=test.id&client_secret=test.client.secret&grant_type=client_credentials" @url=#<URI::HTTP http://test-auth-server.gov.uk/oauth/token> @request=#<Faraday::RequestOptions timeout=8> @request_headers={"User-Agent"=>"Faraday v2.10.1", "Content-Type"=>"application/x-www-form-urlencoded"} @ssl=#<Faraday::SSLOptions (empty)> @response=#<Faraday::Response:0x000000012cf93e68 ...> @response_headers={"content-type"=>"application/json"} @status=200 @reason_phrase="" @response_body="{\"access_token\":\"abc\",\"expires_in\":3600,\"token_type\":\"bearer\"}">>, @options={:parse=>:automatic, :snaky=>true}, @parser=#<Proc:0x000000012c1cdb08 /Users/barryhalper/.rvm/gems/ruby-3.3.4/gems/oauth2-2.0.9/lib/oauth2/response.rb:142>, @parsed=#<SnakyHash::StringKeyed access_token="abc" expires_in=3600 token_type="bearer">>>, @base_uri="http://epb-data-warehouse-api", @client=#<OAuth2::Client:0x000000012cf7b278 @id="test.id", @secret="test.client.secret", @site="http://test-auth-server.gov.uk:80", @options={:authorize_url=>"oauth/authorize", :token_url=>"/oauth/token", :token_method=>:post, :auth_scheme=>:request_body, :connection_opts=>{:request=>{:timeout=>8}}, :connection_build=>nil, :max_redirects=>5, :raise_errors=>false, :logger=>#<Logger:0x000000012cf7b228 @level=0, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012de56180 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012cf7b1d8 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012de56158>, @mon_data_owner_object_id=5780>, @level_override={}>, :access_token_class=>OAuth2::AccessToken, :authorisation_url=>"/oauth/token"}, @client_credentials=#<OAuth2::Strategy::ClientCredentials:0x000000012d633908 @client=#<OAuth2::Client:0x000000012cf7b278 ...>>, @connection=#<Faraday::Connection:0x0000000104c5d708 @parallel_manager=nil, @headers={"User-Agent"=>"Faraday v2.10.1"}, @params={}, @options=#<Faraday::RequestOptions timeout=8>, @ssl=#<Faraday::SSLOptions (empty)>, @default_parallel_manager=nil, @manual_proxy=false, @builder=#<Faraday::RackBuilder:0x000000012d6335c0 @adapter=Faraday::Adapter::NetHttp, @handlers=[Faraday::Request::UrlEncoded], @app=#<Faraday::Request::UrlEncoded:0x000000012cf997a0 @app=#<Faraday::Adapter::NetHttp:0x000000012cf7ff58 @ssl_cert_store=nil, @app=#<Proc:0x000000012dad28b0(&:response) (lambda)>, @connection_options={}, @config_block=nil>, @options={}>>, @url_prefix=#<URI::HTTP http://test-auth-server.gov.uk/>, @proxy=nil>>>>>}>, @logger=#<Logger:0x000000012a45f328 @level=1, @progname=nil, @default_formatter=#<Logger::Formatter:0x000000012dc76cc0 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x000000012a45f2d8 @shift_period_suffix=nil, @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<IO:<STDOUT>>, @binmode=false, @mon_data=#<Monitor:0x000000012dc76c98>, @mon_data_owner_object_id=5800>, @level_override={}>>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :xss_mode=>:block, :nosniff=>true, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>true}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>true}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :allow_if=>nil, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>true}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>true}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :allow_if=>nil, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>true}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml", "text/xml", "application/xml"], :frame_options=>:sameorigin, :img_src=>"'self' data:", :font_src=>"'self'", :without_session=>true}>> |
-
rack.request.cookie_hash | -{} |
-
rack.request.cookie_string | -- |
rack.request.form_hash | -{} |
-
rack.request.form_input | -nil |
-
rack.request.query_hash | -{"country"=>"northern-ireland"} |
-
rack.request.query_string | -country=northern-ireland |
-
rack.test | -true |
-
rack.url_scheme | -http |
-
sinatra.accept | -[#<Sinatra::Request::AcceptEntry:0x000000012d59f640 @entry="*/*", @type="*/*", @params={}, @q=1.0>] |
-
sinatra.error | -#<WebMock::NetConnectNotAllowedError:"Real HTTP connections are disabled. Unregistered request: GET http://epb-data-warehouse-api/api/avg-co2-emissions with headers {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization'=>'Bearer abc', 'User-Agent'=>'Faraday v2.10.1'}\n\nYou can stub this request with the following snippet:\n\nstub_request(:get, \"http://epb-data-warehouse-api/api/avg-co2-emissions\").\n with(\n headers: {\n\t 'Accept'=>'*/*',\n\t 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',\n\t 'Authorization'=>'Bearer abc',\n\t 'User-Agent'=>'Faraday v2.10.1'\n }).\n to_return(status: 200, body: \"\", headers: {})\n\nregistered request stubs:\n\nstub_request(:get, \"http://test-api.gov.uk/api/statistics\")\nstub_request(:post, \"http://test-auth-server.gov.uk/oauth/token\").\n with(\n body: {\"client_id\"=>\"test.id\", \"client_secret\"=>\"test.client.secret\", \"grant_type\"=>\"client_credentials\"},\n headers: {\n\t 'Accept'=>'*/*',\n\t 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',\n\t 'Content-Type'=>'application/x-www-form-urlencoded'\n })\n\n============================================================"> |
-
sinatra.route | -GET /service-performance/download-csv |
-
You're seeing this error because you have
-enabled the show_exceptions
setting.