diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/DataSourceHealthIndicator.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/DataSourceHealthIndicator.java index ffe2c81a33..138d39ab74 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/DataSourceHealthIndicator.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/DataSourceHealthIndicator.java @@ -43,6 +43,7 @@ import org.springframework.util.StringUtils; * @author Christian Dupuis * @author Andy Wilkinson * @author Stephane Nicoll + * @author Arthur Kalimullin * @since 1.1.0 */ public class DataSourceHealthIndicator extends AbstractHealthIndicator implements @@ -203,13 +204,22 @@ public class DataSourceHealthIndicator extends AbstractHealthIndicator implement }, - INFORMIX("Informix Dynamic Server", "select count(*) from systables"); + INFORMIX("Informix Dynamic Server", "select count(*) from systables"), + + FIREBIRD("Firebird", "SELECT 1 FROM RDB$DATABASE") { + + @Override + protected boolean matchesProduct(String product) { + return super.matchesProduct(product) + || product.toLowerCase().startsWith("firebird"); + } + }; private final String product; private final String query; - private Product(String product, String query) { + Product(String product, String query) { this.product = product; this.query = query; } diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/DataSourceHealthIndicatorTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/DataSourceHealthIndicatorTests.java index 40d65ff7d9..563382739b 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/DataSourceHealthIndicatorTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/DataSourceHealthIndicatorTests.java @@ -110,6 +110,8 @@ public class DataSourceHealthIndicatorTests { assertThat(Product.forProduct("DB2/LINUXX8664"), equalTo(Product.DB2)); assertThat(Product.forProduct("Informix Dynamic Server"), equalTo(Product.INFORMIX)); + assertThat(Product.forProduct("Firebird 2.5.WI"), equalTo(Product.FIREBIRD)); + assertThat(Product.forProduct("Firebird 2.1.LI"), equalTo(Product.FIREBIRD)); } }