tarttelin / JavaStubServer

An HTTP server used in tests to provide canned responses to expected requests.
http://tarttelin.github.io/JavaStubServer/
Other
6 stars 5 forks source link

NullPointerException in StubServer.getLocalPort #12

Open rickb777 opened 10 years ago

rickb777 commented 10 years ago

The documentation does not explain that it is necessary to call StubServer.start() before StubServer.getLocalPort()

A NullpointerException arises if these are in the wrong order (line 197).

It would be nicer to throw an IllegalStateException intead, explaining what's wrong.