Consul { public boolean isValid() { try { final Response response = httpClient .target(endpoint) .path("/v1/kv/") .request() .get(); return response.getStatus() == Response.Status.BAD_REQUEST.getStatusCode(); } catch (final Exception ce) { return false; } } Consul(final String endpoint); boolean isValid(); ConsulSession createSession(final String name, final int ttlMs, final int lockDelay); boolean writeSessionData(final String name, final String data, final String sessionId); boolean createPermanentData(final String name, final String data); boolean writePermanentData(
            final String name, final String data); boolean removePermanentData(final String name); String readData(final String name); ConsulWatch createWatch(final String pathToWatch); static final int DEFAULT_LOCK_DELAY; }
@Test public void testIsValid() { final Consul consul = new Consul(System.getProperty(EP_PROPERTY)); assertTrue(consul.isValid()); final Consul unavailable = new Consul("http: assertFalse(unavailable.isValid()); }