diff --git a/src/test/java/com/orbitz/consul/util/HttpTest.java b/src/test/java/com/orbitz/consul/util/HttpTest.java index 453f7fc9..70a49aa7 100644 --- a/src/test/java/com/orbitz/consul/util/HttpTest.java +++ b/src/test/java/com/orbitz/consul/util/HttpTest.java @@ -319,4 +319,13 @@ public void consulResponseShouldHaveKnownLeaderIfPresentInHeader() { assertEquals(true, consulResponse.isKnownLeader()); } + + @Test + public void testToString() { + String responseMessage = "success"; + ConsulResponse expectedConsulResponse = new ConsulResponse<>(responseMessage, 0, false, BigInteger.ZERO, null, null); + Response response = Response.success(responseMessage); + ConsulResponse consulResponse = Http.consulResponse(response); + assertEquals("ConsulResponse{response=success, lastContact=0, knownLeader=false, index=0, cache=Optional.empty}", consulResponse.toString()); + } }