Start building against Spring Data Kay snapshots
See gh-7461
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -48,7 +48,8 @@ public class CassandraHealthIndicator extends AbstractHealthIndicator {
|
||||
try {
|
||||
Select select = QueryBuilder.select("release_version").from("system",
|
||||
"local");
|
||||
ResultSet results = this.cassandraOperations.query(select);
|
||||
ResultSet results = this.cassandraOperations.getCqlOperations()
|
||||
.queryForResultSet(select);
|
||||
if (results.isExhausted()) {
|
||||
builder.up();
|
||||
return;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.boot.actuate.health;
|
||||
|
||||
import com.mongodb.CommandResult;
|
||||
import org.bson.Document;
|
||||
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -39,7 +39,7 @@ public class MongoHealthIndicator extends AbstractHealthIndicator {
|
||||
|
||||
@Override
|
||||
protected void doHealthCheck(Health.Builder builder) throws Exception {
|
||||
CommandResult result = this.mongoTemplate.executeCommand("{ buildInfo: 1 }");
|
||||
Document result = this.mongoTemplate.executeCommand("{ buildInfo: 1 }");
|
||||
builder.up().withDetail("version", result.getString("version"));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package org.springframework.boot.actuate.health;
|
||||
|
||||
import com.mongodb.CommandResult;
|
||||
import com.mongodb.MongoException;
|
||||
import org.bson.Document;
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -65,7 +65,7 @@ public class MongoHealthIndicatorTests {
|
||||
|
||||
@Test
|
||||
public void mongoIsUp() throws Exception {
|
||||
CommandResult commandResult = mock(CommandResult.class);
|
||||
Document commandResult = mock(Document.class);
|
||||
given(commandResult.getString("version")).willReturn("2.6.4");
|
||||
MongoTemplate mongoTemplate = mock(MongoTemplate.class);
|
||||
given(mongoTemplate.executeCommand("{ buildInfo: 1 }")).willReturn(commandResult);
|
||||
|
||||
Reference in New Issue
Block a user