Commit 69faa7dd authored by Stephane Nicoll's avatar Stephane Nicoll

Remove useless cast

The number of nodes can be added to the details without the need to cast
it.

Closes gh-10078
parent a37a4592
...@@ -27,6 +27,7 @@ import org.neo4j.ogm.session.SessionFactory; ...@@ -27,6 +27,7 @@ import org.neo4j.ogm.session.SessionFactory;
* statement. * statement.
* *
* @author Eric Spiegelberg * @author Eric Spiegelberg
* @author Stephane Nicoll
* @since 2.0.0 * @since 2.0.0
*/ */
public class Neo4jHealthIndicator extends AbstractHealthIndicator { public class Neo4jHealthIndicator extends AbstractHealthIndicator {
...@@ -51,8 +52,8 @@ public class Neo4jHealthIndicator extends AbstractHealthIndicator { ...@@ -51,8 +52,8 @@ public class Neo4jHealthIndicator extends AbstractHealthIndicator {
protected void doHealthCheck(Health.Builder builder) throws Exception { protected void doHealthCheck(Health.Builder builder) throws Exception {
Session session = this.sessionFactory.openSession(); Session session = this.sessionFactory.openSession();
Result result = session.query(CYPHER, Collections.emptyMap()); Result result = session.query(CYPHER, Collections.emptyMap());
int nodes = (int) result.queryResults().iterator().next().get("nodes"); builder.up().withDetail("nodes", result.queryResults()
builder.up().withDetail("nodes", nodes); .iterator().next().get("nodes"));
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment