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

Need to allow server to be embedded #312

Closed
farrukhnajmi opened this issue Oct 27, 2018 · 4 comments
Closed

Need to allow server to be embedded #312

farrukhnajmi opened this issue Oct 27, 2018 · 4 comments

Comments

@farrukhnajmi
Copy link
Contributor

I need to run the actual server from a system test program. Ideally the com.networknt.server.Server would allows doing this by moving the main methods content into an init() method that could be called from my test. I have created a trivial pull request #311 that addresses this need.

@stevehu
Copy link
Contributor

stevehu commented Oct 27, 2018

@farrukhnajmi I have reviewed your PR and there is no issue. I am a little curious about your use case. Could you please explain what is your test harness and why you don't want to use the built-in TestServer for your unit and integration test. This might help us to learn new testing approach. Thanks.

@stevehu
Copy link
Contributor

stevehu commented Oct 28, 2018

Cool. I remember other people asked to run a light-4j instance in another Java process before and I think this resolves that issue. Thanks a lot. I have assigned the PR for other team members to review. It should be in the next release.

@farrukhnajmi
Copy link
Contributor Author

farrukhnajmi commented Oct 29, 2018

@farrukhnajmi I have reviewed your PR and there is no issue. I am a little curious about your use case. Could you please explain what is your test harness and why you don't want to use the built-in TestServer for your unit and integration test. This might help us to learn new testing approach. Thanks.

I am writing a system test using Spock framework. The test sends a message to a remote service and then uses an actual light-4j server (not test server) to listen for events from the actual deployed remote service. This protocol is fixed and I cannot change that. My test is an end-to-end system test with no mocks. When events are received from remote service, the test compares them to expected events.

@stevehu
Copy link
Contributor

stevehu commented Nov 26, 2018

This has been released in 1.5.22. Close the issue. Thank you.

@stevehu stevehu closed this as completed Nov 26, 2018
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