Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "sanity check" tests for AgentClient#ping (#268)
This relates to an issue that was in the original consul-client library: rickfast/consul-client#282 The issue claimed that calling AgentClient#ping resulted in a java.io.EOFException which we've never seen. But, go ahead and add an explicit test for this method. Since it is void, the best we can do here is assert that no exception is thrown when Consul is running. Add test for successful ping and for a failed ping when Consul cannot be connected to. The failed test is a RetryingTest that attempts to connect to Consul using a random port between 50000 and 65535. It will make up to five attempts before giving up. This should be more than enough attempts to find a port that causes a failure. I expect this to usually only make one attempt, but don't want to hard code the port, and don't want to fail in the (very unlikely) event there actually is a Consul running on the randomly selected port.
- Loading branch information