Uploaded image for project: 'Quarkus'
  1. Quarkus
  2. QUARKUS-3188

Fix RestAssured URL handling and unexpected restarts in QuarkusProdModeTest

    XMLWordPrintable

Details

    Description

      This is fixing an issue we had over at https://github.com/quarkiverse/quarkus-cxf/pull/669#issuecomment-1382911655 (cc @shumonsharif @ppalaga).

      Without this fix QuarkusProdModeTest does the following when `run` and `expectExit` are enabled:

      • `beforeAll`:
      • start the app and wait for it to exit
      • setup RestAssured URL (`RestAssuredURLManager` stores the previous port)
      • `beforeEach` :
      • again start the app and wait for it to exit
      • again setup RestAssured URL, loosing the initially stored port to restore
      • `afterAll`:
      • clear the RestAssured URL, but not with the initially stored port

      This fix:

      • makes sure that the app is not stared again for each test method when `expectExit` is enabled
      • does not even set up RestAssured URL when `expectExit` is enabled (App will have exited anyway)
      • make setup/clean of RestAssured URL consistent with (manual) `start()`/`stop()`

      Please note that there can still be inconsistencies w.r.t. to the URL when using multiple `QuarkusProdModeTest`s because there is only one static URL Manager, not one for each extension.

      Attachments

        Activity

          People

            Unassigned Unassigned
            probinso_jira Quarkus JIRA Bot
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: