Move code from spring-boot-actuator into spring-boot-neo4j

This commit is contained in:
Andy Wilkinson
2025-05-12 10:42:48 +01:00
committed by Phillip Webb
parent 048cc5a6da
commit f0a8c8fa28
14 changed files with 35 additions and 40 deletions

View File

@@ -21,12 +21,12 @@ import org.neo4j.driver.Driver;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.neo4j.Neo4jHealthContributorConfigurations.Neo4jConfiguration;
import org.springframework.boot.actuate.autoconfigure.neo4j.Neo4jHealthContributorConfigurations.Neo4jReactiveConfiguration;
import org.springframework.boot.actuate.neo4j.Neo4jHealthIndicator;
import org.springframework.boot.actuate.neo4j.Neo4jReactiveHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.neo4j.actuate.health.Neo4jHealthIndicator;
import org.springframework.boot.neo4j.actuate.health.Neo4jReactiveHealthIndicator;
import org.springframework.context.annotation.Import;
/**

View File

@@ -24,10 +24,10 @@ import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthCont
import org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthContributorConfiguration;
import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.actuate.health.ReactiveHealthContributor;
import org.springframework.boot.actuate.neo4j.Neo4jHealthIndicator;
import org.springframework.boot.actuate.neo4j.Neo4jReactiveHealthIndicator;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.neo4j.actuate.health.Neo4jHealthIndicator;
import org.springframework.boot.neo4j.actuate.health.Neo4jReactiveHealthIndicator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -40,6 +40,7 @@ import org.springframework.context.annotation.Configuration;
class Neo4jHealthContributorConfigurations {
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(Neo4jHealthIndicator.class)
static class Neo4jConfiguration extends CompositeHealthContributorConfiguration<Neo4jHealthIndicator, Driver> {
Neo4jConfiguration() {
@@ -55,7 +56,7 @@ class Neo4jHealthContributorConfigurations {
}
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(Flux.class)
@ConditionalOnClass({ Flux.class, Neo4jReactiveHealthIndicator.class })
static class Neo4jReactiveConfiguration
extends CompositeReactiveHealthContributorConfiguration<Neo4jReactiveHealthIndicator, Driver> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 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.
@@ -24,9 +24,9 @@ import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAu
import org.springframework.boot.actuate.health.AbstractHealthIndicator;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.actuate.neo4j.Neo4jHealthIndicator;
import org.springframework.boot.actuate.neo4j.Neo4jReactiveHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.neo4j.actuate.health.Neo4jHealthIndicator;
import org.springframework.boot.neo4j.actuate.health.Neo4jReactiveHealthIndicator;
import org.springframework.boot.test.context.FilteredClassLoader;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.context.annotation.Bean;

View File

@@ -3,7 +3,6 @@ plugins {
id "java-test-fixtures"
id "org.springframework.boot.configuration-properties"
id "org.springframework.boot.optional-dependencies"
id "org.springframework.boot.docker-test"
id "org.springframework.boot.deployed"
}
@@ -12,17 +11,6 @@ description = "Spring Boot Actuator"
dependencies {
api(project(":spring-boot-project:spring-boot"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-autoconfigure"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-neo4j"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-test"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
dockerTestImplementation("org.assertj:assertj-core")
dockerTestImplementation("org.junit.jupiter:junit-jupiter")
dockerTestImplementation("org.springframework:spring-test")
dockerTestImplementation("org.testcontainers:junit-jupiter")
dockerTestImplementation("org.testcontainers:neo4j")
dockerTestImplementation("org.testcontainers:testcontainers")
optional(project(":spring-boot-project:spring-boot-http-converter"))
optional(project(":spring-boot-project:spring-boot-jetty"))
optional(project(":spring-boot-project:spring-boot-jsonb"))
@@ -59,7 +47,6 @@ dependencies {
optional("org.glassfish.jersey.containers:jersey-container-servlet-core")
optional("org.hibernate.validator:hibernate-validator")
optional("org.influxdb:influxdb-java")
optional("org.neo4j.driver:neo4j-java-driver")
optional("org.quartz-scheduler:quartz")
optional("org.springframework:spring-context-support")
optional("org.springframework:spring-jdbc")

View File

@@ -13,6 +13,9 @@ dependencies {
api(project(":spring-boot-project:spring-boot"))
api("org.neo4j.driver:neo4j-java-driver")
compileOnly("com.fasterxml.jackson.core:jackson-annotations")
optional(project(":spring-boot-project:spring-boot-actuator"))
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-test"))
@@ -21,8 +24,11 @@ dependencies {
dockerTestImplementation("org.testcontainers:junit-jupiter")
dockerTestImplementation("org.testcontainers:neo4j")
testCompileOnly("com.fasterxml.jackson.core:jackson-annotations")
testImplementation(project(":spring-boot-project:spring-boot-test"))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation("io.projectreactor:reactor-test")
testRuntimeOnly("ch.qos.logback:logback-classic")
}

View File

@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.neo4j.actuate.health.Neo4jReactiveHealthIndicator;
import org.springframework.boot.neo4j.autoconfigure.Neo4jAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.testsupport.container.TestImage;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2025 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.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.neo4j;
package org.springframework.boot.neo4j.actuate.health;
import org.neo4j.driver.Record;
import org.neo4j.driver.summary.ResultSummary;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 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.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.neo4j;
package org.springframework.boot.neo4j.actuate.health;
import org.neo4j.driver.summary.DatabaseInfo;
import org.neo4j.driver.summary.ResultSummary;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 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.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.neo4j;
package org.springframework.boot.neo4j.actuate.health;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -38,7 +38,7 @@ import org.springframework.boot.actuate.health.HealthIndicator;
* @author Eric Spiegelberg
* @author Stephane Nicoll
* @author Michael J. Simons
* @since 2.0.0
* @since 4.0.0
*/
public class Neo4jHealthIndicator extends AbstractHealthIndicator {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 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.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.neo4j;
package org.springframework.boot.neo4j.actuate.health;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -39,7 +39,7 @@ import org.springframework.boot.actuate.health.ReactiveHealthIndicator;
* @author Michael J. Simons
* @author Stephane Nicoll
* @author Phillip Webb
* @since 2.4.0
* @since 4.0.0
*/
public final class Neo4jReactiveHealthIndicator extends AbstractReactiveHealthIndicator {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2025 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.
@@ -15,6 +15,6 @@
*/
/**
* Actuator support for Neo4j.
* Health integration for Neo4j.
*/
package org.springframework.boot.actuate.neo4j;
package org.springframework.boot.neo4j.actuate.health;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2025 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.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.neo4j;
package org.springframework.boot.neo4j.actuate.health;
import java.util.concurrent.atomic.AtomicInteger;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 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.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.neo4j;
package org.springframework.boot.neo4j.actuate.health;
import java.time.Duration;
import java.util.concurrent.atomic.AtomicInteger;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2025 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.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.neo4j;
package org.springframework.boot.neo4j.actuate.health;
import org.neo4j.driver.summary.DatabaseInfo;
import org.neo4j.driver.summary.ResultSummary;