From b2ebfc0ecb34c8cf17de6907656229fa4a5af81e Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Mon, 29 Jan 2018 18:56:11 -0500 Subject: [PATCH] Updates to new ServletEndpoint and ControllerEndpoint --- .../hystrix/HystrixAutoConfiguration.java | 64 +++++++++++++++- .../netflix/hystrix/HystrixProperties.java | 33 +-------- ...ServletManagementContextConfiguration.java | 73 ------------------- .../hystrix/HystrixStreamEndpoint.java | 47 ++++++++++++ ...oller.java => HystrixWebfluxEndpoint.java} | 20 ++--- ...WebfluxManagementContextConfiguration.java | 64 ---------------- .../main/resources/META-INF/spring.factories | 4 - .../hystrix/HystrixStreamEndpointTests.java | 11 +-- ....java => HystrixWebfluxEndpointTests.java} | 9 +-- 9 files changed, 131 insertions(+), 194 deletions(-) delete mode 100644 spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixServletManagementContextConfiguration.java create mode 100644 spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixStreamEndpoint.java rename spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/{HystrixWebfluxController.java => HystrixWebfluxEndpoint.java} (70%) delete mode 100644 spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixWebfluxManagementContextConfiguration.java rename spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/hystrix/{HystrixWebfluxControllerTests.java => HystrixWebfluxEndpointTests.java} (93%) diff --git a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixAutoConfiguration.java b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixAutoConfiguration.java index 19722d39..efc05d96 100644 --- a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixAutoConfiguration.java +++ b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-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. @@ -12,19 +12,38 @@ * 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.cloud.netflix.hystrix; +import org.reactivestreams.Publisher; +import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnEnabledEndpoint; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; +import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.cloud.client.actuator.HasFeatures; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.web.reactive.DispatcherHandler; import com.netflix.hystrix.Hystrix; +import com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect; +import com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsStreamServlet; +import com.netflix.hystrix.metric.consumer.HystrixDashboardStream; +import com.netflix.hystrix.serial.SerialHystrixDashboardData; + +import static org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type.REACTIVE; +import static org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type.SERVLET; + +import rx.Observable; +import rx.RxReactiveStreams; /** * Auto configuration for Hystrix. @@ -43,4 +62,47 @@ public class HystrixAutoConfiguration { return new HystrixHealthIndicator(); } + /** + * See original {@link org.springframework.boot.actuate.autoconfigure.jolokia.JolokiaEndpointAutoConfiguration} + */ + @Configuration + @ConditionalOnWebApplication(type = SERVLET) + @ConditionalOnBean(HystrixCommandAspect.class) // only install the stream if enabled + @ConditionalOnClass({ Health.class, HystrixMetricsStreamServlet.class }) + @EnableConfigurationProperties(HystrixProperties.class) + protected static class HystrixServletAutoConfiguration { + + @Bean + @ConditionalOnEnabledEndpoint + public HystrixStreamEndpoint hystrixStreamEndpoint(HystrixProperties properties) { + return new HystrixStreamEndpoint(properties.getConfig()); + } + + @Bean + public HasFeatures hystrixStreamFeature() { + return HasFeatures.namedFeature("Hystrix Stream Servlet", HystrixMetricsStreamServlet.class); + } + } + + @Configuration + @ConditionalOnWebApplication(type = REACTIVE) + @ConditionalOnBean(HystrixCommandAspect.class) // only install the stream if enabled + @ConditionalOnClass({ Health.class, DispatcherHandler.class }) + @EnableConfigurationProperties(HystrixProperties.class) + protected static class HystrixWebfluxManagementContextConfiguration { + + @Bean + @ConditionalOnEnabledEndpoint + public HystrixWebfluxEndpoint hystrixWebfluxController() { + Observable serializedDashboardData = HystrixDashboardStream.getInstance().observe() + .concatMap(dashboardData -> Observable.from(SerialHystrixDashboardData.toMultipleJsonStrings(dashboardData))); + Publisher publisher = RxReactiveStreams.toPublisher(serializedDashboardData); + return new HystrixWebfluxEndpoint(publisher); + } + + @Bean + public HasFeatures hystrixStreamFeature() { + return HasFeatures.namedFeature("Hystrix Stream Webflux", HystrixMetricsStreamServlet.class); + } + } } diff --git a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixProperties.java b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixProperties.java index 43f318a7..2039c62c 100644 --- a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixProperties.java +++ b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixProperties.java @@ -1,17 +1,18 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-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 + * 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.cloud.netflix.hystrix; @@ -27,41 +28,15 @@ import org.springframework.boot.context.properties.ConfigurationProperties; * @author Spencer Gibb * @since 2.0.0 */ -@ConfigurationProperties(prefix = "management.hystrix") +@ConfigurationProperties(prefix = "management.endpoint.hystrix") public class HystrixProperties { - /** - * Enable Hystrix Stream. - */ - private boolean enabled; - - /** - * Path at which Hystrix Stream will be available. - */ - private String path = "/hystrix.stream"; - /** * Hystrix settings. These are traditionally set using servlet parameters. Refer to * the documentation of Hystrix for more details. */ private final Map config = new HashMap<>(); - public boolean isEnabled() { - return this.enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - - public String getPath() { - return this.path; - } - - public void setPath(String path) { - this.path = path; - } - public Map getConfig() { return this.config; } diff --git a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixServletManagementContextConfiguration.java b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixServletManagementContextConfiguration.java deleted file mode 100644 index e6e7e11c..00000000 --- a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixServletManagementContextConfiguration.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2013-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. - * 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.cloud.netflix.hystrix; - -import org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration; -import org.springframework.boot.actuate.autoconfigure.web.servlet.ManagementServletContext; -import org.springframework.boot.actuate.health.Health; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.boot.web.servlet.ServletRegistrationBean; -import org.springframework.cloud.client.actuator.HasFeatures; -import org.springframework.context.annotation.Bean; - -import com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect; -import com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsStreamServlet; - -import static org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type.SERVLET; - -/** - * See original {@link org.springframework.boot.actuate.autoconfigure.jolokia.JolokiaManagementContextConfiguration} - */ -@ManagementContextConfiguration -@ConditionalOnProperty(value = "management.hystrix.enabled", matchIfMissing = true) -@ConditionalOnWebApplication(type = SERVLET) -@ConditionalOnBean(HystrixCommandAspect.class) // only install the stream if enabled -@ConditionalOnClass({ Health.class, HystrixMetricsStreamServlet.class }) -@EnableConfigurationProperties(HystrixProperties.class) -class HystrixServletManagementContextConfiguration { - - private final ManagementServletContext managementServletContext; - - private final HystrixProperties properties; - - public HystrixServletManagementContextConfiguration( - ManagementServletContext managementServletContext, - HystrixProperties properties) { - this.managementServletContext = managementServletContext; - this.properties = properties; - } - - @Bean - public ServletRegistrationBean hystrixMetricsStreamServlet() { - String path = this.managementServletContext.getServletPath() - + this.properties.getPath(); - String urlMapping = (path.endsWith("/") ? path + "*" : path + "/*"); - ServletRegistrationBean registration = new ServletRegistrationBean<>( - new HystrixMetricsStreamServlet(), urlMapping); - registration.setInitParameters(this.properties.getConfig()); - return registration; - } - - @Bean - public HasFeatures hystrixStreamFeature() { - return HasFeatures.namedFeature("Hystrix Stream Servlet", HystrixMetricsStreamServlet.class); - } -} diff --git a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixStreamEndpoint.java b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixStreamEndpoint.java new file mode 100644 index 00000000..af2d870b --- /dev/null +++ b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixStreamEndpoint.java @@ -0,0 +1,47 @@ +/* + * Copyright 2013-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.cloud.netflix.hystrix; + +import com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsStreamServlet; +import org.springframework.boot.actuate.endpoint.web.EndpointServlet; +import org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpoint; + +import java.util.Map; +import java.util.function.Supplier; + +/** + * {@link org.springframework.boot.actuate.endpoint.annotation.Endpoint} to expose a Jolokia {@link HystrixMetricsStreamServlet}. + * + * @author Phillip Webb + * @since 2.0.0 + */ +@ServletEndpoint(id = "hystrix.stream") +public class HystrixStreamEndpoint implements Supplier { + + private final Map initParameters; + + public HystrixStreamEndpoint(Map initParameters) { + this.initParameters = initParameters; + } + + @Override + public EndpointServlet get() { + return new EndpointServlet(HystrixMetricsStreamServlet.class) + .withInitParameters(this.initParameters); + } +} diff --git a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixWebfluxController.java b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixWebfluxEndpoint.java similarity index 70% rename from spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixWebfluxController.java rename to spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixWebfluxEndpoint.java index c5d12583..a9f4f220 100644 --- a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixWebfluxController.java +++ b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixWebfluxEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2018 the original author or authors. + * Copyright 2013-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. @@ -12,35 +12,35 @@ * 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.cloud.netflix.hystrix; +import java.time.Duration; + import org.reactivestreams.Publisher; +import org.springframework.boot.actuate.endpoint.web.annotation.RestControllerEndpoint; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import reactor.core.publisher.Flux; -import java.time.Duration; - /** * @author Spencer Gibb */ -@RestController -@RequestMapping("${management.endpoints.web.base-path:/actuator}${management.hystrix.path:/hystrix.stream}") -public class HystrixWebfluxController { +@RestControllerEndpoint(id = "hystrix.stream") +public class HystrixWebfluxEndpoint { private final Flux stream; - public HystrixWebfluxController(Publisher dashboardData) { + public HystrixWebfluxEndpoint(Publisher dashboardData) { stream = Flux.interval(Duration.ofMillis(500)).map(aLong -> "{\"type\":\"ping\"}") .mergeWith(dashboardData).share(); } - @GetMapping(produces = MediaType.TEXT_EVENT_STREAM_VALUE) + // path needs to be empty, so it registers correct as /actuator/hystrix.stream + @GetMapping(path = "", produces = MediaType.TEXT_EVENT_STREAM_VALUE) public Flux hystrixStream() { return stream; } diff --git a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixWebfluxManagementContextConfiguration.java b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixWebfluxManagementContextConfiguration.java deleted file mode 100644 index d1e243d7..00000000 --- a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/hystrix/HystrixWebfluxManagementContextConfiguration.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2014-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.cloud.netflix.hystrix; - -import org.reactivestreams.Publisher; -import org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration; -import org.springframework.boot.actuate.health.Health; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.cloud.client.actuator.HasFeatures; -import org.springframework.context.annotation.Bean; -import org.springframework.web.reactive.DispatcherHandler; - -import com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect; -import com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsStreamServlet; -import com.netflix.hystrix.metric.consumer.HystrixDashboardStream; -import com.netflix.hystrix.serial.SerialHystrixDashboardData; - -import static org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type.REACTIVE; - -import rx.Observable; -import rx.RxReactiveStreams; - -/** - * See original {@link org.springframework.boot.actuate.autoconfigure.jolokia.JolokiaManagementContextConfiguration} - */ -@ManagementContextConfiguration -@ConditionalOnProperty(value = "management.hystrix.enabled", matchIfMissing = true) -@ConditionalOnWebApplication(type = REACTIVE) -@ConditionalOnBean(HystrixCommandAspect.class) // only install the stream if enabled -@ConditionalOnClass({ Health.class, DispatcherHandler.class }) -@EnableConfigurationProperties(HystrixProperties.class) -class HystrixWebfluxManagementContextConfiguration { - - @Bean - public HystrixWebfluxController hystrixWebfluxController() { - Observable serializedDashboardData = HystrixDashboardStream.getInstance().observe() - .concatMap(dashboardData -> Observable.from(SerialHystrixDashboardData.toMultipleJsonStrings(dashboardData))); - Publisher publisher = RxReactiveStreams.toPublisher(serializedDashboardData); - return new HystrixWebfluxController(publisher); - } - - @Bean - public HasFeatures hystrixStreamFeature() { - return HasFeatures.namedFeature("Hystrix Stream Webflux", HystrixMetricsStreamServlet.class); - } -} diff --git a/spring-cloud-netflix-core/src/main/resources/META-INF/spring.factories b/spring-cloud-netflix-core/src/main/resources/META-INF/spring.factories index 3f56702d..d14e8902 100644 --- a/spring-cloud-netflix-core/src/main/resources/META-INF/spring.factories +++ b/spring-cloud-netflix-core/src/main/resources/META-INF/spring.factories @@ -9,7 +9,3 @@ org.springframework.cloud.netflix.ribbon.RibbonAutoConfiguration org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker=\ org.springframework.cloud.netflix.hystrix.HystrixCircuitBreakerConfiguration - -org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration=\ -org.springframework.cloud.netflix.hystrix.HystrixServletManagementContextConfiguration,\ -org.springframework.cloud.netflix.hystrix.HystrixWebfluxManagementContextConfiguration diff --git a/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/hystrix/HystrixStreamEndpointTests.java b/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/hystrix/HystrixStreamEndpointTests.java index 3f372731..405cb987 100644 --- a/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/hystrix/HystrixStreamEndpointTests.java +++ b/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/hystrix/HystrixStreamEndpointTests.java @@ -1,17 +1,18 @@ /* - * Copyright 2013-2017 the original author or authors. + * Copyright 2013-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 + * 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.cloud.netflix.hystrix; @@ -63,12 +64,6 @@ public class HystrixStreamEndpointTests { @LocalServerPort private int port = 0; - @Test - public void pathStartsWithSlash() { - HystrixProperties properties = new HystrixProperties(); - assertEquals("/hystrix.stream", properties.getPath()); - } - @Test public void hystrixStreamWorks() throws Exception { String url = "http://localhost:" + port; diff --git a/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/hystrix/HystrixWebfluxControllerTests.java b/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/hystrix/HystrixWebfluxEndpointTests.java similarity index 93% rename from spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/hystrix/HystrixWebfluxControllerTests.java rename to spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/hystrix/HystrixWebfluxEndpointTests.java index af0710fd..c8a2bd2a 100644 --- a/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/hystrix/HystrixWebfluxControllerTests.java +++ b/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/hystrix/HystrixWebfluxEndpointTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2018 the original author or authors. + * Copyright 2013-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. @@ -12,6 +12,7 @@ * 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.cloud.netflix.hystrix; @@ -23,10 +24,8 @@ import org.apache.commons.logging.LogFactory; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.SpringBootConfiguration; -import org.springframework.boot.WebApplicationType; import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.web.server.LocalServerPort; import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; @@ -55,9 +54,9 @@ import reactor.test.StepVerifier; "spring.main.web-application-type=reactive", "spring.application.name=hystrixstreamwebfluxtest", /*"debug=true"*/ }) @DirtiesContext -public class HystrixWebfluxControllerTests { +public class HystrixWebfluxEndpointTests { private static final String BASE_PATH = new WebEndpointProperties().getBasePath(); - private static final Log log = LogFactory.getLog(HystrixWebfluxControllerTests.class); + private static final Log log = LogFactory.getLog(HystrixWebfluxEndpointTests.class); @LocalServerPort private int port;