Uploaded image for project: 'Hybrid Cloud Console'
  1. Hybrid Cloud Console
  2. RHCLOUD-33415

HTTP 400 status code response for valid request that should be a 404

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False
    • None
    • Unset
    • No
    • Plat-Ex Services Sprint 19
    • Moderate

      Using the download_pdf endpoint, an automated test attempts to download a PDF by giving a generated ID. I was expecting the response to be a 404, but the endpoint returned HTTP 400 status code instead.

      Steps to reproduce:

      Here is the example test code to reproduce the issue from the IQE plugin:

      pdf_api = application.platform_ui.rest_client.pdf_api
      fake_status_id = nonexistent_status_id()
      with pytest.raises(NotFoundException) as nfe:
          pdf_api.get_pdf_status(fake_status_id)
      assert f"No PDF status found for {fake_status_id}" in nfe.value.body 

      Actual Result
      The generated client receives an HTTP 400 from the endpoint and surfaces the issue as an ApiError instead of a NotFoundException. Example

      E           HTTP response body: {"error":{"status":400,"statusText":"PDF status could not be determined","description":"Error: TypeError: Cannot read properties of undefined (reading 'components')"}} 

       

              bholifie Blake Holifield (Inactive)
              btweed@redhat.com Brandon Tweed
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: