Start building against Spring Data Kay snapshots

See gh-7461
This commit is contained in:
Andy Wilkinson
2017-01-20 19:47:37 +00:00
parent 0acfee44c5
commit d4c4bc35fd
6 changed files with 34 additions and 22 deletions

View File

@@ -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;

View File

@@ -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"));
}

View File

@@ -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);