Neo4jResponse { public String displayErrors() { StringBuilder sb = new StringBuilder(); if (hasErrors()) { sb.append("Some errors occurred : \n"); for (SQLException error : errors) { sb.append("[").append(error.getSQLState()).append("]").append(":").append(error.getMessage()).append("\n"); } } return sb.toString(); } Neo4jResponse(HttpResponse response, ObjectMapper mapper); Integer getCode(); String getLocation(); List<Neo4jResult> getResults(); Neo4jResult getFirstResult(); List<SQLException> getErrors(); boolean hasErrors(); boolean hasResultSets(); String displayErrors();  }
@Test public void displayErrorShouldSucceed() throws SQLException { Neo4jResponse response = generateNeo4jResponse(Boolean.FALSE); Assert.assertEquals(0, response.displayErrors().length()); response = generateNeo4jResponse(Boolean.TRUE); Assert.assertTrue(response.displayErrors().length() > 0); }