Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testability - expose access to InetSocketAddress of HttpServer #19

Open
szczebel opened this issue Dec 10, 2020 · 2 comments
Open

testability - expose access to InetSocketAddress of HttpServer #19

szczebel opened this issue Dec 10, 2020 · 2 comments

Comments

@szczebel
Copy link

When running tests on CI/CD, I need to start the application under test on random port with Express.listen(0).
Then I'd like to obtain the actual port number to hand it over to RestAssured (or whatever other rest client)

Proposed addition to express.Express class:

public InetSocketAddress getAddress() {
    return httpServer.getAddress(); 
}
@masecla22
Copy link

This has been addressed in my fork of this project if you want to check it out.
https://github.com/masecla22/java-express

You can access it through

Express.getHttpServer().getAddress();

@szczebel
Copy link
Author

This has been addressed in my fork of this project if you want to check it out.
https://github.com/masecla22/java-express

You can access it through

Express.getHttpServer().getAddress();

@masecla22 , I see the Express.getHttpServer() on your master, but it seems unpublished - this method is not existing in com.github.masecla22:java-express:0.2.2. Would you mind publishing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants