commit
2735f57b0d
|
|
@ -55,7 +55,7 @@ public final class EndpointRequest {
|
||||||
* {@link EndpointServerWebExchangeMatcher#excluding(Class...) excluding} method can
|
* {@link EndpointServerWebExchangeMatcher#excluding(Class...) excluding} method can
|
||||||
* be used to further remove specific endpoints if required. For example:
|
* be used to further remove specific endpoints if required. For example:
|
||||||
* <pre class="code">
|
* <pre class="code">
|
||||||
* EndpointServerWebExchangeMatcher.toAnyEndpoint().excluding(ShutdownEndpoint.class)
|
* EndpointRequest.toAnyEndpoint().excluding(ShutdownEndpoint.class)
|
||||||
* </pre>
|
* </pre>
|
||||||
* @return the configured {@link ServerWebExchangeMatcher}
|
* @return the configured {@link ServerWebExchangeMatcher}
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ public abstract class AbstractDiscoveredEndpoint<O extends Operation>
|
||||||
private final Object endpointBean;
|
private final Object endpointBean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a mew {@link AbstractDiscoveredEndpoint} instance.
|
* Create a new {@link AbstractDiscoveredEndpoint} instance.
|
||||||
* @param discoverer the discoverer that discovered the endpoint
|
* @param discoverer the discoverer that discovered the endpoint
|
||||||
* @param endpointBean the primary source bean
|
* @param endpointBean the primary source bean
|
||||||
* @param id the ID of the endpoint
|
* @param id the ID of the endpoint
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ import org.springframework.util.StringUtils;
|
||||||
* A discovered {@link JmxOperation JMX operation}.
|
* A discovered {@link JmxOperation JMX operation}.
|
||||||
*
|
*
|
||||||
* @author Stephane Nicoll
|
* @author Stephane Nicoll
|
||||||
* @author Philip Webb
|
* @author Phillip Webb
|
||||||
*/
|
*/
|
||||||
class DiscoveredJmxOperation extends AbstractDiscoveredOperation implements JmxOperation {
|
class DiscoveredJmxOperation extends AbstractDiscoveredOperation implements JmxOperation {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ public class EndpointDiscovererTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getEndpointsWhenTtlSetByIdAndIdDoesntMatchShouldNotCacheInvokeCalls() {
|
public void getEndpointsWhenTtlSetByIdAndIdDoesNotMatchShouldNotCacheInvokeCalls() {
|
||||||
load(TestEndpointConfiguration.class, (context) -> {
|
load(TestEndpointConfiguration.class, (context) -> {
|
||||||
TestEndpointDiscoverer discoverer = new TestEndpointDiscoverer(context,
|
TestEndpointDiscoverer discoverer = new TestEndpointDiscoverer(context,
|
||||||
(endpointId) -> (endpointId.equals("foo") ? 500L : 0L));
|
(endpointId) -> (endpointId.equals("foo") ? 500L : 0L));
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ public class OperationMethodParameterTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getTypeShouldReturnTyoe() {
|
public void getTypeShouldReturnType() {
|
||||||
OperationMethodParameter parameter = new OperationMethodParameter("name",
|
OperationMethodParameter parameter = new OperationMethodParameter("name",
|
||||||
this.method.getParameters()[0]);
|
this.method.getParameters()[0]);
|
||||||
assertThat(parameter.getType()).isEqualTo(String.class);
|
assertThat(parameter.getType()).isEqualTo(String.class);
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ public class ReflectiveOperationInvokerTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void createWhenParamaterValueMapperIsNullShouldThrowException() {
|
public void createWhenParameterValueMapperIsNullShouldThrowException() {
|
||||||
this.thrown.expect(IllegalArgumentException.class);
|
this.thrown.expect(IllegalArgumentException.class);
|
||||||
this.thrown.expectMessage("ParameterValueMapper must not be null");
|
this.thrown.expectMessage("ParameterValueMapper must not be null");
|
||||||
new ReflectiveOperationInvoker(this.target, this.operationMethod, null);
|
new ReflectiveOperationInvoker(this.target, this.operationMethod, null);
|
||||||
|
|
@ -88,7 +88,7 @@ public class ReflectiveOperationInvokerTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void invokeWhenMissingNonNullableArgmentShouldThrowException() {
|
public void invokeWhenMissingNonNullableArgumentShouldThrowException() {
|
||||||
ReflectiveOperationInvoker invoker = new ReflectiveOperationInvoker(this.target,
|
ReflectiveOperationInvoker invoker = new ReflectiveOperationInvoker(this.target,
|
||||||
this.operationMethod, this.parameterValueMapper);
|
this.operationMethod, this.parameterValueMapper);
|
||||||
this.thrown.expect(MissingParametersException.class);
|
this.thrown.expect(MissingParametersException.class);
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ public class WebEndpointResponseTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void createWhithBodyAndStatusShouldReturnStatusAndBody() {
|
public void createWithBodyAndStatusShouldReturnStatusAndBody() {
|
||||||
WebEndpointResponse<Object> response = new WebEndpointResponse<>("body", 500);
|
WebEndpointResponse<Object> response = new WebEndpointResponse<>("body", 500);
|
||||||
assertThat(response.getStatus()).isEqualTo(500);
|
assertThat(response.getStatus()).isEqualTo(500);
|
||||||
assertThat(response.getBody()).isEqualTo("body");
|
assertThat(response.getBody()).isEqualTo("body");
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,7 @@ public class FileSystemWatcher {
|
||||||
* @param remainingScans the number of remaining scans
|
* @param remainingScans the number of remaining scans
|
||||||
*/
|
*/
|
||||||
void stopAfter(int remainingScans) {
|
void stopAfter(int remainingScans) {
|
||||||
Thread thread = null;
|
Thread thread;
|
||||||
synchronized (this.monitor) {
|
synchronized (this.monitor) {
|
||||||
thread = this.watchThread;
|
thread = this.watchThread;
|
||||||
if (thread != null) {
|
if (thread != null) {
|
||||||
|
|
|
||||||
|
|
@ -1225,7 +1225,7 @@ content into your application. Rather, pick only the properties that you need.
|
||||||
management.endpoint.loggers.cache.time-to-live=0ms # Maximum time that a response can be cached.
|
management.endpoint.loggers.cache.time-to-live=0ms # Maximum time that a response can be cached.
|
||||||
management.endpoint.loggers.enabled= # Whether to enable the loggers endpoint.
|
management.endpoint.loggers.enabled= # Whether to enable the loggers endpoint.
|
||||||
|
|
||||||
# REQUEST MAPPING ENDPOINT ({sc-spring-boot-actuator}/web/MappingsEndpoint.{sc-ext}[MappingsEndpoint])
|
# REQUEST MAPPING ENDPOINT ({sc-spring-boot-actuator}/web/mappings/MappingsEndpoint.{sc-ext}[MappingsEndpoint])
|
||||||
management.endpoint.mappings.cache.time-to-live=0ms # Maximum time that a response can be cached.
|
management.endpoint.mappings.cache.time-to-live=0ms # Maximum time that a response can be cached.
|
||||||
management.endpoint.mappings.enabled= # Whether to enable the mappings endpoint.
|
management.endpoint.mappings.enabled= # Whether to enable the mappings endpoint.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2391,7 +2391,7 @@ following example:
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/{user}/customers")
|
@GetMapping("/{user}/customers")
|
||||||
Flux<Customer> getUserCustomers(@PathVariable Long user) {
|
public Flux<Customer> getUserCustomers(@PathVariable Long user) {
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2437,7 +2437,7 @@ actual handling of the requests, as shown in the following example:
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
|
|
||||||
WebFlux is part of the Spring Framework. and detailed information is available in its
|
WebFlux is part of the Spring Framework and detailed information is available in its
|
||||||
{spring-reference}web-reactive.html#webflux-fn[reference documentation].
|
{spring-reference}web-reactive.html#webflux-fn[reference documentation].
|
||||||
|
|
||||||
TIP: You can define as many `RouterFunction` beans as you like to modularize the
|
TIP: You can define as many `RouterFunction` beans as you like to modularize the
|
||||||
|
|
@ -6313,7 +6313,7 @@ Often, `@WebFluxTest` is limited to a single controller and used in combination
|
||||||
`@MockBean` annotation to provide mock implementations for required collaborators.
|
`@MockBean` annotation to provide mock implementations for required collaborators.
|
||||||
|
|
||||||
`@WebFluxTest` also auto-configures
|
`@WebFluxTest` also auto-configures
|
||||||
{spring-reference}testing.html#webtestclient[`WebTestClient`]`WebTestClient`, which offers
|
{spring-reference}testing.html#webtestclient[`WebTestClient`], which offers
|
||||||
a powerful way to quickly test WebFlux controllers without needing to start a full HTTP
|
a powerful way to quickly test WebFlux controllers without needing to start a full HTTP
|
||||||
server.
|
server.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,4 +42,4 @@ public class RandomPortTestRestTemplateExampleTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// tag::test-random-port[]
|
// end::test-random-port[]
|
||||||
|
|
|
||||||
|
|
@ -41,4 +41,4 @@ public class RandomPortWebTestClientExampleTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// tag::test-random-port[]
|
// end::test-random-port[]
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ import org.springframework.core.env.PropertySource;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@link FailureAnalyzer} that performs analysis of failures caused by a
|
* A {@link FailureAnalyzer} that performs analysis of failures caused by an
|
||||||
* {@link InvalidConfigurationPropertyValueException}.
|
* {@link InvalidConfigurationPropertyValueException}.
|
||||||
*
|
*
|
||||||
* @author Stephane Nicoll
|
* @author Stephane Nicoll
|
||||||
|
|
|
||||||
|
|
@ -610,9 +610,8 @@ public class MapBinderTests {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, String> convert(String s) {
|
public Map<String, String> convert(String s) {
|
||||||
Map<String, String> map = new HashMap<>();
|
return StringUtils.commaDelimitedListToSet(s).stream()
|
||||||
StringUtils.commaDelimitedListToSet(s).forEach((k) -> map.put(k, ""));
|
.collect(Collectors.toMap((k) -> k, (k) -> ""));
|
||||||
return map;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ public class FailureAnalyzersTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void environmentIsInjectedIntEnvironmentAwareFailureAnalyzers() {
|
public void environmentIsInjectedIntoEnvironmentAwareFailureAnalyzers() {
|
||||||
RuntimeException failure = new RuntimeException();
|
RuntimeException failure = new RuntimeException();
|
||||||
analyzeAndReport("basic.factories", failure);
|
analyzeAndReport("basic.factories", failure);
|
||||||
verify(failureAnalyzer).setEnvironment(any(Environment.class));
|
verify(failureAnalyzer).setEnvironment(any(Environment.class));
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ public class SampleSecureWebFluxCustomSecurityTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||||
http.authorizeExchange().matchers(EndpointRequest.to("health", "info"))
|
http.authorizeExchange().matchers(EndpointRequest.to("health", "info"))
|
||||||
.permitAll().matchers(EndpointRequest.toAnyEndpoint())
|
.permitAll().matchers(EndpointRequest.toAnyEndpoint())
|
||||||
.hasRole("ACTUATOR")
|
.hasRole("ACTUATOR")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue