From 8c67ef10791cfef3d77415fe2d6c0c377ee6af6a Mon Sep 17 00:00:00 2001 From: Tim Ysewyn Date: Sun, 25 Feb 2018 15:52:10 +0100 Subject: [PATCH 1/2] Add actuator endpoint for exposing the Spring Integration graph See gh-12331 --- .../asciidoc/endpoints/integrationgraph.adoc | 40 +++++++++++ .../src/main/asciidoc/index.adoc | 1 + ...grationGraphEndpointAutoConfiguration.java | 49 +++++++++++++ .../integration/package-info.java | 20 ++++++ .../main/resources/META-INF/spring.factories | 1 + ...rationGraphEndpointDocumentationTests.java | 69 ++++++++++++++++++ ...onGraphEndpointAutoConfigurationTests.java | 68 ++++++++++++++++++ .../integration/IntegrationGraphEndpoint.java | 58 +++++++++++++++ .../actuate/integration/package-info.java | 20 ++++++ .../IntegrationGraphEndpointTests.java | 70 ++++++++++++++++++ ...ationGraphEndpointWebIntegrationTests.java | 71 +++++++++++++++++++ .../IntegrationAutoConfiguration.java | 8 +++ .../IntegrationAutoConfigurationTests.java | 3 + .../asciidoc/production-ready-features.adoc | 8 +++ 14 files changed, 486 insertions(+) create mode 100644 spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/integrationgraph.adoc create mode 100644 spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/integration/IntegrationGraphEndpointAutoConfiguration.java create mode 100644 spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/integration/package-info.java create mode 100644 spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/IntegrationGraphEndpointDocumentationTests.java create mode 100644 spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integration/IntegrationGraphEndpointAutoConfigurationTests.java create mode 100644 spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpoint.java create mode 100644 spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/integration/package-info.java create mode 100644 spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpointTests.java create mode 100644 spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpointWebIntegrationTests.java diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/integrationgraph.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/integrationgraph.adoc new file mode 100644 index 0000000000..fd5d8f4a8a --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/integrationgraph.adoc @@ -0,0 +1,40 @@ +[[integrationgraph]] += Spring Integration graph (`integrationgraph`) + +The `integrationgraph` endpoint exposes a graph containing all Spring Integration components. + + + +[[integrationgraph-retrieving]] +== Retrieving the Spring Integration graph + +To retrieve the information about the application, make a `GET` request to +`/actuator/integrationgraph`, as shown in the following curl-based example: + +include::{snippets}integrationgraph/graph/curl-request.adoc[] + +The resulting response is similar to the following: + +include::{snippets}integrationgraph/graph/http-response.adoc[] + + + +[[integrationgraph-retrieving-response-structure]] +=== Response Structure + +The response contains all Spring Integration components used within the application, as well as the links between them. +More information about the structure can be found in the https://docs.spring.io/spring-integration/reference/html/system-management-chapter.html#integration-graph[subchapter] for the integration graph in the reference documentation of Spring Integration. + + + +[[integrationgraph-rebuilding]] +== Rebuilding the Spring Integration graph + +To rebuild the exposed graph, make a `POST` request to +`/actuator/integrationgraph`, as shown in the following curl-based example: + +include::{snippets}integrationgraph/rebuild/curl-request.adoc[] + +This will result in a `204 - No Content` response: + +include::{snippets}integrationgraph/rebuild/http-response.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/index.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/index.adoc index ac46a02c14..7fb1913b29 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/index.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/index.adoc @@ -59,6 +59,7 @@ include::endpoints/health.adoc[leveloffset=+1] include::endpoints/heapdump.adoc[leveloffset=+1] include::endpoints/httptrace.adoc[leveloffset=+1] include::endpoints/info.adoc[leveloffset=+1] +include::endpoints/integrationgraph.adoc[leveloffset=+1] include::endpoints/liquibase.adoc[leveloffset=+1] include::endpoints/logfile.adoc[leveloffset=+1] include::endpoints/loggers.adoc[leveloffset=+1] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/integration/IntegrationGraphEndpointAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/integration/IntegrationGraphEndpointAutoConfiguration.java new file mode 100644 index 0000000000..4bf6ea4560 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/integration/IntegrationGraphEndpointAutoConfiguration.java @@ -0,0 +1,49 @@ +/* + * Copyright 2012-2018 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.actuate.autoconfigure.integration; + +import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnEnabledEndpoint; +import org.springframework.boot.actuate.integration.IntegrationGraphEndpoint; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.integration.support.management.graph.IntegrationGraphServer; + +/** + * {@link EnableAutoConfiguration Auto-configuration} for the {@link IntegrationGraphEndpoint}. + * + * @author Tim Ysewyn + * @since 2.1.0 + */ +@Configuration +@ConditionalOnClass(IntegrationGraphServer.class) +public class IntegrationGraphEndpointAutoConfiguration { + + @Bean + @ConditionalOnBean(IntegrationGraphServer.class) + @ConditionalOnMissingBean + @ConditionalOnEnabledEndpoint + public IntegrationGraphEndpoint integrationGraphEndpoint( + IntegrationGraphServer integrationGraphServer) { + return new IntegrationGraphEndpoint(integrationGraphServer); + } + +} + diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/integration/package-info.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/integration/package-info.java new file mode 100644 index 0000000000..20e0a9b7d9 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/integration/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2012-2018 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Auto-configuration for actuator Spring Integration concerns. + */ +package org.springframework.boot.actuate.autoconfigure.integration; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring.factories index 01ba105602..f5d7a66caf 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring.factories +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring.factories @@ -21,6 +21,7 @@ org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfigu org.springframework.boot.actuate.autoconfigure.influx.InfluxDbHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.info.InfoContributorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.info.InfoEndpointAutoConfiguration,\ +org.springframework.boot.actuate.autoconfigure.integration.IntegrationGraphEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.jms.JmsHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.jolokia.JolokiaEndpointAutoConfiguration,\ diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/IntegrationGraphEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/IntegrationGraphEndpointDocumentationTests.java new file mode 100644 index 0000000000..0ccc5dd153 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/IntegrationGraphEndpointDocumentationTests.java @@ -0,0 +1,69 @@ +/* + * Copyright 2012-2018 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.actuate.autoconfigure.endpoint.web.documentation; + +import org.junit.Test; + +import org.springframework.boot.actuate.integration.IntegrationGraphEndpoint; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; +import org.springframework.integration.config.EnableIntegration; +import org.springframework.integration.support.management.graph.IntegrationGraphServer; +import org.springframework.restdocs.mockmvc.MockMvcRestDocumentation; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +/** + * Tests for generating documentation describing the {@link IntegrationGraphEndpoint}. + * + * @author Tim Ysewyn + */ +public class IntegrationGraphEndpointDocumentationTests extends MockMvcEndpointDocumentationTests { + + @Test + public void graph() throws Exception { + this.mockMvc.perform(get("/actuator/integrationgraph")).andExpect(status().isOk()) + .andDo(MockMvcRestDocumentation.document("integrationgraph/graph")); + } + + @Test + public void rebuild() throws Exception { + this.mockMvc.perform(post("/actuator/integrationgraph")).andExpect(status().isNoContent()) + .andDo(MockMvcRestDocumentation.document("integrationgraph/rebuild")); + } + + @Configuration + @EnableIntegration + @Import(BaseDocumentationConfiguration.class) + static class TestConfiguration { + + @Bean + public IntegrationGraphServer integrationGraphServer() { + return new IntegrationGraphServer(); + } + + @Bean + public IntegrationGraphEndpoint endpoint() { + return new IntegrationGraphEndpoint(integrationGraphServer()); + } + + } + +} diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integration/IntegrationGraphEndpointAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integration/IntegrationGraphEndpointAutoConfigurationTests.java new file mode 100644 index 0000000000..7ba5a60c1b --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integration/IntegrationGraphEndpointAutoConfigurationTests.java @@ -0,0 +1,68 @@ +/* + * Copyright 2012-2018 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.actuate.autoconfigure.integration; + +import org.junit.Test; + +import org.springframework.boot.actuate.integration.IntegrationGraphEndpoint; +import org.springframework.boot.autoconfigure.AutoConfigurations; +import org.springframework.boot.test.context.runner.ApplicationContextRunner; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.integration.support.management.graph.IntegrationGraphServer; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Tests for {@link IntegrationGraphEndpointAutoConfiguration}. + * + * @author Tim Ysewyn + */ +public class IntegrationGraphEndpointAutoConfigurationTests { + + private final ApplicationContextRunner contextRunnerWithoutIntegrationGraph = new ApplicationContextRunner() + .withConfiguration(AutoConfigurations.of(IntegrationGraphEndpointAutoConfiguration.class)); + + private final ApplicationContextRunner contextRunnerWithIntegrationGraph = new ApplicationContextRunner() + .withConfiguration(AutoConfigurations.of(IntegrationGraphEndpointAutoConfiguration.class)) + .withUserConfiguration(TestConfiguration.class); + + @Test + public void runShouldNotHaveEndpointBean() { + this.contextRunnerWithoutIntegrationGraph.run((context) -> assertThat(context).doesNotHaveBean(IntegrationGraphEndpoint.class)); + this.contextRunnerWithoutIntegrationGraph.withPropertyValues("management.endpoint.integrationgraph.enabled:true") + .run((context) -> assertThat(context).doesNotHaveBean(IntegrationGraphEndpoint.class)); + this.contextRunnerWithIntegrationGraph.run((context) -> assertThat(context).doesNotHaveBean(IntegrationGraphEndpoint.class)); + } + + @Test + public void runWhenEnabledPropertyIsTrueShouldHaveEndpointBean() { + this.contextRunnerWithIntegrationGraph.withPropertyValues("management.endpoint.integrationgraph.enabled:true") + .run((context) -> assertThat(context).hasSingleBean(IntegrationGraphEndpoint.class)); + } + + @Configuration + public static class TestConfiguration { + + @Bean + public IntegrationGraphServer integrationGraphServer() { + return new IntegrationGraphServer(); + } + + } + +} diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpoint.java new file mode 100644 index 0000000000..7eb8d5aad9 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpoint.java @@ -0,0 +1,58 @@ +/* + * Copyright 2012-2018 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.actuate.integration; + +import org.springframework.boot.actuate.endpoint.annotation.Endpoint; +import org.springframework.boot.actuate.endpoint.annotation.ReadOperation; +import org.springframework.boot.actuate.endpoint.annotation.WriteOperation; +import org.springframework.integration.support.management.graph.Graph; +import org.springframework.integration.support.management.graph.IntegrationGraphServer; + +/** + * {@link Endpoint} to expose the Spring Integration graph. + * + * @author Tim Ysewyn + * @since 2.1.0 + */ +@Endpoint(id = "integrationgraph", enableByDefault = false) +public class IntegrationGraphEndpoint { + + private final IntegrationGraphServer integrationGraphServer; + + /** + * Creates a new {@code IntegrationGraphEndpoint} that exposes a graph containing all the + * Spring Integration components in the given {@code integrationGraphServer}. + * + * @param integrationGraphServer the integration graph server + * @see IntegrationGraphServer + */ + public IntegrationGraphEndpoint(IntegrationGraphServer integrationGraphServer) { + this.integrationGraphServer = integrationGraphServer; + } + + @ReadOperation + public Graph graph() { + return this.integrationGraphServer.getGraph(); + } + + + @WriteOperation + public void rebuild() { + this.integrationGraphServer.rebuild(); + } + +} diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/integration/package-info.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/integration/package-info.java new file mode 100644 index 0000000000..6801a40a58 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/integration/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2012-2018 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Actuator support relating to Spring Integration. + */ +package org.springframework.boot.actuate.integration; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpointTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpointTests.java new file mode 100644 index 0000000000..a50ac5e867 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpointTests.java @@ -0,0 +1,70 @@ +/* + * Copyright 2012-2018 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.actuate.integration; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +import org.springframework.integration.support.management.graph.Graph; +import org.springframework.integration.support.management.graph.IntegrationGraphServer; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.BDDMockito.mock; +import static org.mockito.BDDMockito.verify; +import static org.mockito.BDDMockito.when; + +/** + * Tests for {@link IntegrationGraphEndpoint}. + * + * @author Tim Ysewyn + */ +public class IntegrationGraphEndpointTests { + + @Mock + private IntegrationGraphServer integrationGraphServer; + + @InjectMocks + private IntegrationGraphEndpoint integrationGraphEndpoint; + + @Before + public void setUp() { + MockitoAnnotations.initMocks(this); + } + + @Test + public void shouldReturnGraph() { + Graph mockedGraph = mock(Graph.class); + when(this.integrationGraphServer.getGraph()).thenReturn(mockedGraph); + + Graph graph = this.integrationGraphEndpoint.graph(); + + verify(this.integrationGraphServer).getGraph(); + + assertThat(graph).isEqualTo(mockedGraph); + } + + @Test + public void shouldRebuildGraph() { + this.integrationGraphEndpoint.rebuild(); + + verify(this.integrationGraphServer).rebuild(); + } + +} diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpointWebIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpointWebIntegrationTests.java new file mode 100644 index 0000000000..dcfbd39347 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpointWebIntegrationTests.java @@ -0,0 +1,71 @@ +/* + * Copyright 2012-2018 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.actuate.integration; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.springframework.boot.actuate.endpoint.web.test.WebEndpointRunners; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.integration.config.EnableIntegration; +import org.springframework.integration.support.management.graph.IntegrationGraphServer; +import org.springframework.test.web.reactive.server.WebTestClient; + +/** + * Integration tests for {@link IntegrationGraphEndpoint} exposed by Jersey, Spring MVC, and WebFlux. + * + * @author Tim Ysewyn + */ +@RunWith(WebEndpointRunners.class) +public class IntegrationGraphEndpointWebIntegrationTests { + + private static WebTestClient client; + + @Test + public void graph() { + client.get().uri("/actuator/integrationgraph").accept(MediaType.APPLICATION_JSON).exchange() + .expectStatus().isOk().expectBody() + .jsonPath("contentDescriptor.providerVersion").isEqualTo("5.0.3.RELEASE") + .jsonPath("contentDescriptor.providerFormatVersion").isEqualTo(1.0f) + .jsonPath("contentDescriptor.provider").isEqualTo("spring-integration"); + } + + @Test + public void rebuild() { + client.post().uri("/actuator/integrationgraph").accept(MediaType.APPLICATION_JSON).exchange() + .expectStatus().isNoContent(); + } + + @Configuration + @EnableIntegration + public static class TestConfiguration { + + @Bean + public IntegrationGraphEndpoint endpoint(IntegrationGraphServer integrationGraphServer) { + return new IntegrationGraphEndpoint(integrationGraphServer); + } + + @Bean + public IntegrationGraphServer integrationGraphServer() { + return new IntegrationGraphServer(); + } + + } + +} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration.java index 016c3fa0d6..4de51998d5 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration.java @@ -43,6 +43,7 @@ import org.springframework.integration.jdbc.store.JdbcMessageStore; import org.springframework.integration.jmx.config.EnableIntegrationMBeanExport; import org.springframework.integration.monitor.IntegrationMBeanExporter; import org.springframework.integration.support.management.IntegrationManagementConfigurer; +import org.springframework.integration.support.management.graph.IntegrationGraphServer; import org.springframework.util.StringUtils; /** @@ -54,6 +55,7 @@ import org.springframework.util.StringUtils; * @author Stephane Nicoll * @author Vedran Pavic * @author Madhura Bhave + * @author Tim Ysewyn * @since 1.1.0 */ @Configuration @@ -69,6 +71,12 @@ public class IntegrationAutoConfiguration { @EnableIntegration protected static class IntegrationConfiguration { + @Bean + @ConditionalOnMissingBean + public IntegrationGraphServer integrationGraphServer() { + return new IntegrationGraphServer(); + } + } /** diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java index 9bc0518bbe..ab9ee920ea 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java @@ -42,6 +42,7 @@ import org.springframework.integration.gateway.RequestReplyExchanger; import org.springframework.integration.handler.MessageProcessor; import org.springframework.integration.support.channel.HeaderChannelRegistry; import org.springframework.integration.support.management.IntegrationManagementConfigurer; +import org.springframework.integration.support.management.graph.IntegrationGraphServer; import org.springframework.jdbc.BadSqlGrammarException; import org.springframework.jdbc.core.JdbcOperations; import org.springframework.jmx.export.MBeanExporter; @@ -55,6 +56,7 @@ import static org.mockito.Mockito.mock; * @author Artem Bilan * @author Stephane Nicoll * @author Vedran Pavic + * @author Tim Ysewyn */ public class IntegrationAutoConfigurationTests { @@ -68,6 +70,7 @@ public class IntegrationAutoConfigurationTests { @Test public void integrationIsAvailable() { this.contextRunner.run((context) -> { + assertThat(context).hasSingleBean(IntegrationGraphServer.class); assertThat(context).hasSingleBean(TestGateway.class); assertThat(context) .hasSingleBean(IntegrationComponentScanAutoConfiguration.class); diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc index e006f6f37d..eb68a5932f 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc @@ -105,6 +105,10 @@ exchanges). |Displays arbitrary application info. |Yes +|`integrationgraph` +|Exposes the Spring Integration graph. +|No + |`loggers` |Shows and modifies the configuration of loggers in the application. |Yes @@ -252,6 +256,10 @@ endpoints: |Yes |Yes +|`integrationgraph` +|Yes +|Yes + |`jolokia` |N/A |No From 03cf4fbb10d72bb061cb7e7e651e68f6de027dee Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Tue, 17 Apr 2018 15:40:39 +0200 Subject: [PATCH 2/2] Polish "Add actuator endpoint for exposing the Spring Integration graph" Closes gh-12331 --- .../asciidoc/endpoints/integrationgraph.adoc | 13 +++-- ...grationGraphEndpointAutoConfiguration.java | 14 +++++- ...rationGraphEndpointDocumentationTests.java | 3 +- ...onGraphEndpointAutoConfigurationTests.java | 50 ++++++++++--------- .../integration/IntegrationGraphEndpoint.java | 21 ++++---- .../actuate/integration/package-info.java | 2 +- .../IntegrationGraphEndpointTests.java | 7 +-- ...ationGraphEndpointWebIntegrationTests.java | 2 +- .../IntegrationAutoConfiguration.java | 8 --- .../IntegrationAutoConfigurationTests.java | 3 -- .../asciidoc/production-ready-features.adoc | 4 +- 11 files changed, 64 insertions(+), 63 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/integrationgraph.adoc b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/integrationgraph.adoc index fd5d8f4a8a..8d0e3a19cc 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/integrationgraph.adoc +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/asciidoc/endpoints/integrationgraph.adoc @@ -1,7 +1,8 @@ [[integrationgraph]] = Spring Integration graph (`integrationgraph`) -The `integrationgraph` endpoint exposes a graph containing all Spring Integration components. +The `integrationgraph` endpoint exposes a graph containing all Spring Integration +components. @@ -22,16 +23,18 @@ include::{snippets}integrationgraph/graph/http-response.adoc[] [[integrationgraph-retrieving-response-structure]] === Response Structure -The response contains all Spring Integration components used within the application, as well as the links between them. -More information about the structure can be found in the https://docs.spring.io/spring-integration/reference/html/system-management-chapter.html#integration-graph[subchapter] for the integration graph in the reference documentation of Spring Integration. +The response contains all Spring Integration components used within the application, as +well as the links between them. More information about the structure can be found in the +https://docs.spring.io/spring-integration/reference/html/system-management-chapter.html#integration-graph[reference +documentation]. [[integrationgraph-rebuilding]] == Rebuilding the Spring Integration graph -To rebuild the exposed graph, make a `POST` request to -`/actuator/integrationgraph`, as shown in the following curl-based example: +To rebuild the exposed graph, make a `POST` request to `/actuator/integrationgraph`, as +shown in the following curl-based example: include::{snippets}integrationgraph/rebuild/curl-request.adoc[] diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/integration/IntegrationGraphEndpointAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/integration/IntegrationGraphEndpointAutoConfiguration.java index 4bf6ea4560..ddc838a6bc 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/integration/IntegrationGraphEndpointAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/integration/IntegrationGraphEndpointAutoConfiguration.java @@ -18,26 +18,31 @@ package org.springframework.boot.actuate.autoconfigure.integration; import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnEnabledEndpoint; import org.springframework.boot.actuate.integration.IntegrationGraphEndpoint; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.integration.support.channel.HeaderChannelRegistry; import org.springframework.integration.support.management.graph.IntegrationGraphServer; /** * {@link EnableAutoConfiguration Auto-configuration} for the {@link IntegrationGraphEndpoint}. * * @author Tim Ysewyn + * @author Stephane Nicoll * @since 2.1.0 */ @Configuration @ConditionalOnClass(IntegrationGraphServer.class) +@ConditionalOnBean(HeaderChannelRegistry.class) +@AutoConfigureAfter(IntegrationAutoConfiguration.class) public class IntegrationGraphEndpointAutoConfiguration { @Bean - @ConditionalOnBean(IntegrationGraphServer.class) @ConditionalOnMissingBean @ConditionalOnEnabledEndpoint public IntegrationGraphEndpoint integrationGraphEndpoint( @@ -45,5 +50,12 @@ public class IntegrationGraphEndpointAutoConfiguration { return new IntegrationGraphEndpoint(integrationGraphServer); } + @Bean + @ConditionalOnMissingBean + @ConditionalOnEnabledEndpoint(endpoint = IntegrationGraphEndpoint.class) + public IntegrationGraphServer integrationGraphServer() { + return new IntegrationGraphServer(); + } + } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/IntegrationGraphEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/IntegrationGraphEndpointDocumentationTests.java index 0ccc5dd153..1e16977b79 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/IntegrationGraphEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/IntegrationGraphEndpointDocumentationTests.java @@ -45,7 +45,8 @@ public class IntegrationGraphEndpointDocumentationTests extends MockMvcEndpointD @Test public void rebuild() throws Exception { - this.mockMvc.perform(post("/actuator/integrationgraph")).andExpect(status().isNoContent()) + this.mockMvc.perform(post("/actuator/integrationgraph")).andExpect(status() + .isNoContent()) .andDo(MockMvcRestDocumentation.document("integrationgraph/rebuild")); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integration/IntegrationGraphEndpointAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integration/IntegrationGraphEndpointAutoConfigurationTests.java index 7ba5a60c1b..53f5575d19 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integration/IntegrationGraphEndpointAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integration/IntegrationGraphEndpointAutoConfigurationTests.java @@ -20,9 +20,9 @@ import org.junit.Test; import org.springframework.boot.actuate.integration.IntegrationGraphEndpoint; import org.springframework.boot.autoconfigure.AutoConfigurations; +import org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration; +import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration; import org.springframework.boot.test.context.runner.ApplicationContextRunner; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.integration.support.management.graph.IntegrationGraphServer; import static org.assertj.core.api.Assertions.assertThat; @@ -31,38 +31,40 @@ import static org.assertj.core.api.Assertions.assertThat; * Tests for {@link IntegrationGraphEndpointAutoConfiguration}. * * @author Tim Ysewyn + * @author Stephane Nicoll */ public class IntegrationGraphEndpointAutoConfigurationTests { - private final ApplicationContextRunner contextRunnerWithoutIntegrationGraph = new ApplicationContextRunner() - .withConfiguration(AutoConfigurations.of(IntegrationGraphEndpointAutoConfiguration.class)); - - private final ApplicationContextRunner contextRunnerWithIntegrationGraph = new ApplicationContextRunner() - .withConfiguration(AutoConfigurations.of(IntegrationGraphEndpointAutoConfiguration.class)) - .withUserConfiguration(TestConfiguration.class); + private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() + .withConfiguration(AutoConfigurations.of(JmxAutoConfiguration.class, + IntegrationAutoConfiguration.class, + IntegrationGraphEndpointAutoConfiguration.class)); @Test - public void runShouldNotHaveEndpointBean() { - this.contextRunnerWithoutIntegrationGraph.run((context) -> assertThat(context).doesNotHaveBean(IntegrationGraphEndpoint.class)); - this.contextRunnerWithoutIntegrationGraph.withPropertyValues("management.endpoint.integrationgraph.enabled:true") - .run((context) -> assertThat(context).doesNotHaveBean(IntegrationGraphEndpoint.class)); - this.contextRunnerWithIntegrationGraph.run((context) -> assertThat(context).doesNotHaveBean(IntegrationGraphEndpoint.class)); + public void runShouldHaveEndpointBean() { + this.contextRunner.run((context) -> assertThat(context) + .hasSingleBean(IntegrationGraphEndpoint.class)); } @Test - public void runWhenEnabledPropertyIsTrueShouldHaveEndpointBean() { - this.contextRunnerWithIntegrationGraph.withPropertyValues("management.endpoint.integrationgraph.enabled:true") - .run((context) -> assertThat(context).hasSingleBean(IntegrationGraphEndpoint.class)); + public void runWhenEnabledPropertyIsFalseShouldNotHaveEndpointBean() { + this.contextRunner + .withPropertyValues("management.endpoint.integrationgraph.enabled:false") + .run((context) -> { + assertThat(context).doesNotHaveBean(IntegrationGraphEndpoint.class); + assertThat(context).doesNotHaveBean(IntegrationGraphServer.class); + }); } - @Configuration - public static class TestConfiguration { - - @Bean - public IntegrationGraphServer integrationGraphServer() { - return new IntegrationGraphServer(); - } - + @Test + public void runWhenSpringIntegrationIsNotEnabledShouldNotHaveEndpointBean() { + ApplicationContextRunner noSiRunner = new ApplicationContextRunner() + .withConfiguration(AutoConfigurations.of( + IntegrationGraphEndpointAutoConfiguration.class)); + noSiRunner.run((context) -> { + assertThat(context).doesNotHaveBean(IntegrationGraphEndpoint.class); + assertThat(context).doesNotHaveBean(IntegrationGraphServer.class); + }); } } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpoint.java index 7eb8d5aad9..f2e034e873 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpoint.java @@ -28,31 +28,28 @@ import org.springframework.integration.support.management.graph.IntegrationGraph * @author Tim Ysewyn * @since 2.1.0 */ -@Endpoint(id = "integrationgraph", enableByDefault = false) +@Endpoint(id = "integrationgraph") public class IntegrationGraphEndpoint { - private final IntegrationGraphServer integrationGraphServer; + private final IntegrationGraphServer graphServer; /** - * Creates a new {@code IntegrationGraphEndpoint} that exposes a graph containing all the - * Spring Integration components in the given {@code integrationGraphServer}. - * - * @param integrationGraphServer the integration graph server - * @see IntegrationGraphServer + * Create a new {@code IntegrationGraphEndpoint} that exposes a graph containing all + * the Spring Integration components in the given {@link IntegrationGraphServer}. + * @param graphServer the integration graph server */ - public IntegrationGraphEndpoint(IntegrationGraphServer integrationGraphServer) { - this.integrationGraphServer = integrationGraphServer; + public IntegrationGraphEndpoint(IntegrationGraphServer graphServer) { + this.graphServer = graphServer; } @ReadOperation public Graph graph() { - return this.integrationGraphServer.getGraph(); + return this.graphServer.getGraph(); } - @WriteOperation public void rebuild() { - this.integrationGraphServer.rebuild(); + this.graphServer.rebuild(); } } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/integration/package-info.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/integration/package-info.java index 6801a40a58..f42d84d3f1 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/integration/package-info.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/integration/package-info.java @@ -15,6 +15,6 @@ */ /** - * Actuator support relating to Spring Integration. + * Actuator support for Spring Integration. */ package org.springframework.boot.actuate.integration; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpointTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpointTests.java index a50ac5e867..d4f5808ae5 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpointTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpointTests.java @@ -49,21 +49,18 @@ public class IntegrationGraphEndpointTests { } @Test - public void shouldReturnGraph() { + public void readOperationShouldReturnGraph() { Graph mockedGraph = mock(Graph.class); when(this.integrationGraphServer.getGraph()).thenReturn(mockedGraph); Graph graph = this.integrationGraphEndpoint.graph(); - verify(this.integrationGraphServer).getGraph(); - assertThat(graph).isEqualTo(mockedGraph); } @Test - public void shouldRebuildGraph() { + public void writeOperationShouldRebuildGraph() { this.integrationGraphEndpoint.rebuild(); - verify(this.integrationGraphServer).rebuild(); } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpointWebIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpointWebIntegrationTests.java index dcfbd39347..9fc6fe2103 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpointWebIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/integration/IntegrationGraphEndpointWebIntegrationTests.java @@ -41,7 +41,7 @@ public class IntegrationGraphEndpointWebIntegrationTests { public void graph() { client.get().uri("/actuator/integrationgraph").accept(MediaType.APPLICATION_JSON).exchange() .expectStatus().isOk().expectBody() - .jsonPath("contentDescriptor.providerVersion").isEqualTo("5.0.3.RELEASE") + .jsonPath("contentDescriptor.providerVersion").isNotEmpty() .jsonPath("contentDescriptor.providerFormatVersion").isEqualTo(1.0f) .jsonPath("contentDescriptor.provider").isEqualTo("spring-integration"); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration.java index 4de51998d5..016c3fa0d6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration.java @@ -43,7 +43,6 @@ import org.springframework.integration.jdbc.store.JdbcMessageStore; import org.springframework.integration.jmx.config.EnableIntegrationMBeanExport; import org.springframework.integration.monitor.IntegrationMBeanExporter; import org.springframework.integration.support.management.IntegrationManagementConfigurer; -import org.springframework.integration.support.management.graph.IntegrationGraphServer; import org.springframework.util.StringUtils; /** @@ -55,7 +54,6 @@ import org.springframework.util.StringUtils; * @author Stephane Nicoll * @author Vedran Pavic * @author Madhura Bhave - * @author Tim Ysewyn * @since 1.1.0 */ @Configuration @@ -71,12 +69,6 @@ public class IntegrationAutoConfiguration { @EnableIntegration protected static class IntegrationConfiguration { - @Bean - @ConditionalOnMissingBean - public IntegrationGraphServer integrationGraphServer() { - return new IntegrationGraphServer(); - } - } /** diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java index ab9ee920ea..9bc0518bbe 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java @@ -42,7 +42,6 @@ import org.springframework.integration.gateway.RequestReplyExchanger; import org.springframework.integration.handler.MessageProcessor; import org.springframework.integration.support.channel.HeaderChannelRegistry; import org.springframework.integration.support.management.IntegrationManagementConfigurer; -import org.springframework.integration.support.management.graph.IntegrationGraphServer; import org.springframework.jdbc.BadSqlGrammarException; import org.springframework.jdbc.core.JdbcOperations; import org.springframework.jmx.export.MBeanExporter; @@ -56,7 +55,6 @@ import static org.mockito.Mockito.mock; * @author Artem Bilan * @author Stephane Nicoll * @author Vedran Pavic - * @author Tim Ysewyn */ public class IntegrationAutoConfigurationTests { @@ -70,7 +68,6 @@ public class IntegrationAutoConfigurationTests { @Test public void integrationIsAvailable() { this.contextRunner.run((context) -> { - assertThat(context).hasSingleBean(IntegrationGraphServer.class); assertThat(context).hasSingleBean(TestGateway.class); assertThat(context) .hasSingleBean(IntegrationComponentScanAutoConfiguration.class); diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc index eb68a5932f..bf290b5619 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc @@ -106,8 +106,8 @@ exchanges). |Yes |`integrationgraph` -|Exposes the Spring Integration graph. -|No +|Shows the Spring Integration graph. +|Yes |`loggers` |Shows and modifies the configuration of loggers in the application.