module GdsApi::TestHelpers::LinkCheckerApi

def stub_link_checker_api_check(uri:, status: :ok, checked: nil, errors: [], warnings: [], problem_summary: nil, suggested_fix: nil)

def stub_link_checker_api_check(uri:, status: :ok, checked: nil, errors: [], warnings: [], problem_summary: nil, suggested_fix: nil)
  body = link_checker_api_link_report_hash(
    uri: uri, status: status, checked: checked, errors: errors, warnings: warnings, problem_summary: problem_summary, suggested_fix: suggested_fix,
  ).to_json
  stub_request(:get, "#{LINK_CHECKER_API_ENDPOINT}/check")
    .with(query: { uri: uri })
    .to_return(body: body, status: 200, headers: { "Content-Type" => "application/json" })
end