Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Finding a free port number for tests#

Sumit Rawal answered on May 24, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • how to free port
  • check if a port is working

  • Finding a free port number for tests#

    0

    Due to the nature of integration tests, we want to use production or production-like settings and environment.

    But starting our application or service for each test will be quite cumbersome, so we should provide a base class for our tests. In this class, we will start our service, migrate our database, and provide an opportunity to shut it down properly after testing.

    Because we do not want to get into trouble when running an Akka-HTTP on the same port, we first create a helper function that will determine a free port number. 

    Popularity 1/10 Helpfulness 1/10 Language scala
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on May 24 2023
    Sumit Rawal
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.