|
|
@ -215,6 +215,34 @@ class EndpointRequestTests {
|
|
|
|
assertMatcher(matcher, (PathMappedEndpoints) null).doesNotMatch("/actuator/bar");
|
|
|
|
assertMatcher(matcher, (PathMappedEndpoints) null).doesNotMatch("/actuator/bar");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
void toStringIncludedEndpoints() {
|
|
|
|
|
|
|
|
RequestMatcher matcher = EndpointRequest.to("foo", "bar");
|
|
|
|
|
|
|
|
assertThat(matcher.toString())
|
|
|
|
|
|
|
|
.isEqualTo("EndpointRequest [includes='[foo, bar]', Excludes='[]', IncludeLinks='false']");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
void toStringEmptyIncludedEndpoints() {
|
|
|
|
|
|
|
|
RequestMatcher matcher = EndpointRequest.toAnyEndpoint();
|
|
|
|
|
|
|
|
assertThat(matcher.toString())
|
|
|
|
|
|
|
|
.isEqualTo("EndpointRequest [includes='[*]', Excludes='[]', IncludeLinks='true']");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
void toStringIncludedEndpointsClasses() {
|
|
|
|
|
|
|
|
RequestMatcher matcher = EndpointRequest.to(FooEndpoint.class).excluding("bar");
|
|
|
|
|
|
|
|
assertThat(matcher.toString())
|
|
|
|
|
|
|
|
.isEqualTo("EndpointRequest [includes='[foo]', Excludes='[bar]', IncludeLinks='false']");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
void toStringIncludedExcludedEndpoints() {
|
|
|
|
|
|
|
|
RequestMatcher matcher = EndpointRequest.toAnyEndpoint().excluding("bar").excludingLinks();
|
|
|
|
|
|
|
|
assertThat(matcher.toString())
|
|
|
|
|
|
|
|
.isEqualTo("EndpointRequest [includes='[*]', Excludes='[bar]', IncludeLinks='false']");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private RequestMatcherAssert assertMatcher(RequestMatcher matcher) {
|
|
|
|
private RequestMatcherAssert assertMatcher(RequestMatcher matcher) {
|
|
|
|
return assertMatcher(matcher, mockPathMappedEndpoints("/actuator"));
|
|
|
|
return assertMatcher(matcher, mockPathMappedEndpoints("/actuator"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|