Polish
This commit is contained in:
		
							parent
							
								
									132467787c
								
							
						
					
					
						commit
						27922ae325
					
				|  | @ -48,7 +48,6 @@ public class CassandraHealthIndicator extends AbstractHealthIndicator { | |||
| 
 | ||||
| 	@Override | ||||
| 	protected void doHealthCheck(Health.Builder builder) throws Exception { | ||||
| 		try { | ||||
| 		Select select = QueryBuilder.select("release_version").from("system", | ||||
| 				"local"); | ||||
| 		ResultSet results = this.cassandraOperations.getCqlOperations() | ||||
|  | @ -60,9 +59,5 @@ public class CassandraHealthIndicator extends AbstractHealthIndicator { | |||
| 		String version = results.one().getString(0); | ||||
| 		builder.up().withDetail("version", version); | ||||
| 	} | ||||
| 		catch (Exception ex) { | ||||
| 			builder.down(ex); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
|  |  | |||
|  | @ -108,17 +108,12 @@ public class DataSourceHealthIndicator extends AbstractHealthIndicator | |||
| 		builder.up().withDetail("database", product); | ||||
| 		String validationQuery = getValidationQuery(product); | ||||
| 		if (StringUtils.hasText(validationQuery)) { | ||||
| 			try { | ||||
| 			// Avoid calling getObject as it breaks MySQL on Java 7 | ||||
| 			List<Object> results = this.jdbcTemplate.query(validationQuery, | ||||
| 					new SingleColumnRowMapper()); | ||||
| 			Object result = DataAccessUtils.requiredSingleResult(results); | ||||
| 			builder.withDetail("hello", result); | ||||
| 		} | ||||
| 			catch (Exception ex) { | ||||
| 				builder.down(ex); | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	private String getProduct() { | ||||
|  |  | |||
|  | @ -63,8 +63,10 @@ public class Neo4jHealthIndicator extends AbstractHealthIndicator { | |||
| 	 * {@link Health.Builder Builder}. | ||||
| 	 * @param session the session to use to execute a cypher statement | ||||
| 	 * @param builder the builder to add details to | ||||
| 	 * @throws Exception if getting health details failed | ||||
| 	 */ | ||||
| 	protected void extractResult(Session session, Health.Builder builder) { | ||||
| 	protected void extractResult(Session session, Health.Builder builder) | ||||
| 			throws Exception { | ||||
| 		Result result = session.query(CYPHER, Collections.emptyMap()); | ||||
| 		builder.up().withDetail("nodes", | ||||
| 				result.queryResults().iterator().next().get("nodes")); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue