Format with Eclipse Oxygen SR2
This commit is contained in:
@@ -100,12 +100,13 @@ public class BeansEndpointTests {
|
||||
new ApplicationContextRunner()
|
||||
.withUserConfiguration(EndpointConfiguration.class).withParent(parent)
|
||||
.run((child) -> {
|
||||
ApplicationBeans result = child.getBean(BeansEndpoint.class).beans();
|
||||
assertThat(result.getContexts().get(parent.getId()).getBeans())
|
||||
.containsKey("bean");
|
||||
assertThat(result.getContexts().get(child.getId()).getBeans())
|
||||
.containsKey("endpoint");
|
||||
});
|
||||
ApplicationBeans result = child.getBean(BeansEndpoint.class)
|
||||
.beans();
|
||||
assertThat(result.getContexts().get(parent.getId()).getBeans())
|
||||
.containsKey("bean");
|
||||
assertThat(result.getContexts().get(child.getId()).getBeans())
|
||||
.containsKey("endpoint");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -43,18 +43,20 @@ public class ConfigurationPropertiesReportEndpointParentTests {
|
||||
new ApplicationContextRunner()
|
||||
.withUserConfiguration(ClassConfigurationProperties.class)
|
||||
.withParent(parent).run((child) -> {
|
||||
ConfigurationPropertiesReportEndpoint endpoint = child
|
||||
.getBean(ConfigurationPropertiesReportEndpoint.class);
|
||||
ApplicationConfigurationProperties applicationProperties = endpoint
|
||||
.configurationProperties();
|
||||
assertThat(applicationProperties.getContexts())
|
||||
.containsOnlyKeys(child.getId(), parent.getId());
|
||||
assertThat(applicationProperties.getContexts().get(child.getId())
|
||||
.getBeans().keySet()).containsExactly("someProperties");
|
||||
assertThat((applicationProperties.getContexts()
|
||||
.get(parent.getId()).getBeans().keySet()))
|
||||
.containsExactly("testProperties");
|
||||
});
|
||||
ConfigurationPropertiesReportEndpoint endpoint = child
|
||||
.getBean(
|
||||
ConfigurationPropertiesReportEndpoint.class);
|
||||
ApplicationConfigurationProperties applicationProperties = endpoint
|
||||
.configurationProperties();
|
||||
assertThat(applicationProperties.getContexts())
|
||||
.containsOnlyKeys(child.getId(), parent.getId());
|
||||
assertThat(applicationProperties.getContexts()
|
||||
.get(child.getId()).getBeans().keySet())
|
||||
.containsExactly("someProperties");
|
||||
assertThat((applicationProperties.getContexts()
|
||||
.get(parent.getId()).getBeans().keySet()))
|
||||
.containsExactly("testProperties");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -66,17 +68,19 @@ public class ConfigurationPropertiesReportEndpointParentTests {
|
||||
.withUserConfiguration(
|
||||
BeanMethodConfigurationProperties.class)
|
||||
.withParent(parent).run((child) -> {
|
||||
ConfigurationPropertiesReportEndpoint endpoint = child
|
||||
.getBean(ConfigurationPropertiesReportEndpoint.class);
|
||||
ApplicationConfigurationProperties applicationProperties = endpoint
|
||||
.configurationProperties();
|
||||
assertThat(applicationProperties.getContexts().get(child.getId())
|
||||
.getBeans().keySet())
|
||||
.containsExactlyInAnyOrder("otherProperties");
|
||||
assertThat((applicationProperties.getContexts()
|
||||
.get(parent.getId()).getBeans().keySet()))
|
||||
.containsExactly("testProperties");
|
||||
});
|
||||
ConfigurationPropertiesReportEndpoint endpoint = child
|
||||
.getBean(
|
||||
ConfigurationPropertiesReportEndpoint.class);
|
||||
ApplicationConfigurationProperties applicationProperties = endpoint
|
||||
.configurationProperties();
|
||||
assertThat(applicationProperties.getContexts()
|
||||
.get(child.getId()).getBeans().keySet())
|
||||
.containsExactlyInAnyOrder(
|
||||
"otherProperties");
|
||||
assertThat((applicationProperties.getContexts()
|
||||
.get(parent.getId()).getBeans().keySet()))
|
||||
.containsExactly("testProperties");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ public class JerseyWebEndpointIntegrationTests extends
|
||||
@Override
|
||||
protected void doFilterInternal(HttpServletRequest request,
|
||||
HttpServletResponse response, FilterChain filterChain)
|
||||
throws ServletException, IOException {
|
||||
throws ServletException, IOException {
|
||||
filterChain.doFilter(new HttpServletRequestWrapper(request) {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -66,15 +66,13 @@ public class WebFluxEndpointIntegrationTests
|
||||
|
||||
@Test
|
||||
public void responseToOptionsRequestIncludesCorsHeaders() {
|
||||
load(TestEndpointConfiguration.class,
|
||||
(client) -> client.options().uri("/test")
|
||||
.accept(MediaType.APPLICATION_JSON)
|
||||
.header("Access-Control-Request-Method", "POST")
|
||||
.header("Origin", "http://example.com").exchange().expectStatus()
|
||||
.isOk().expectHeader()
|
||||
.valueEquals("Access-Control-Allow-Origin", "http://example.com")
|
||||
.expectHeader()
|
||||
.valueEquals("Access-Control-Allow-Methods", "GET,POST"));
|
||||
load(TestEndpointConfiguration.class, (client) -> client.options().uri("/test")
|
||||
.accept(MediaType.APPLICATION_JSON)
|
||||
.header("Access-Control-Request-Method", "POST")
|
||||
.header("Origin", "http://example.com").exchange().expectStatus().isOk()
|
||||
.expectHeader()
|
||||
.valueEquals("Access-Control-Allow-Origin", "http://example.com")
|
||||
.expectHeader().valueEquals("Access-Control-Allow-Methods", "GET,POST"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -68,15 +68,13 @@ public class MvcWebEndpointIntegrationTests extends
|
||||
|
||||
@Test
|
||||
public void responseToOptionsRequestIncludesCorsHeaders() {
|
||||
load(TestEndpointConfiguration.class,
|
||||
(client) -> client.options().uri("/test")
|
||||
.accept(MediaType.APPLICATION_JSON)
|
||||
.header("Access-Control-Request-Method", "POST")
|
||||
.header("Origin", "http://example.com").exchange().expectStatus()
|
||||
.isOk().expectHeader()
|
||||
.valueEquals("Access-Control-Allow-Origin", "http://example.com")
|
||||
.expectHeader()
|
||||
.valueEquals("Access-Control-Allow-Methods", "GET,POST"));
|
||||
load(TestEndpointConfiguration.class, (client) -> client.options().uri("/test")
|
||||
.accept(MediaType.APPLICATION_JSON)
|
||||
.header("Access-Control-Request-Method", "POST")
|
||||
.header("Origin", "http://example.com").exchange().expectStatus().isOk()
|
||||
.expectHeader()
|
||||
.valueEquals("Access-Control-Allow-Origin", "http://example.com")
|
||||
.expectHeader().valueEquals("Access-Control-Allow-Methods", "GET,POST"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -147,7 +145,7 @@ public class MvcWebEndpointIntegrationTests extends
|
||||
@Override
|
||||
protected void doFilterInternal(HttpServletRequest request,
|
||||
HttpServletResponse response, FilterChain filterChain)
|
||||
throws ServletException, IOException {
|
||||
throws ServletException, IOException {
|
||||
filterChain.doFilter(new HttpServletRequestWrapper(request) {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -70,8 +70,8 @@ public class MetricsEndpointWebIntegrationTests {
|
||||
|
||||
@Test
|
||||
public void selectByTag() {
|
||||
client.get()
|
||||
.uri("/actuator/metrics/jvm.memory.used?tag=id:Compressed%20Class%20Space")
|
||||
client.get().uri(
|
||||
"/actuator/metrics/jvm.memory.used?tag=id:Compressed%20Class%20Space")
|
||||
.exchange().expectStatus().isOk().expectBody().jsonPath("$.name")
|
||||
.isEqualTo("jvm.memory.used");
|
||||
}
|
||||
|
||||
@@ -69,8 +69,8 @@ public class MetricsRestTemplateCustomizerTests {
|
||||
.andRespond(MockRestResponseCreators.withSuccess("OK",
|
||||
MediaType.APPLICATION_JSON));
|
||||
String result = this.restTemplate.getForObject("/test/{id}", String.class, 123);
|
||||
assertThat(this.registry.find("http.client.requests")
|
||||
.meters()).anySatisfy((m) -> assertThat(
|
||||
assertThat(this.registry.find("http.client.requests").meters())
|
||||
.anySatisfy((m) -> assertThat(
|
||||
StreamSupport.stream(m.getId().getTags().spliterator(), false)
|
||||
.map(Tag::getKey)).doesNotContain("bucket"));
|
||||
assertThat(this.registry.get("http.client.requests")
|
||||
|
||||
@@ -497,7 +497,7 @@ public class WebMvcMetricsFilterTests {
|
||||
@Override
|
||||
protected void doFilterInternal(HttpServletRequest request,
|
||||
HttpServletResponse response, FilterChain filterChain)
|
||||
throws ServletException, IOException {
|
||||
throws ServletException, IOException {
|
||||
String misbehave = request.getHeader(TEST_MISBEHAVE_HEADER);
|
||||
if (misbehave != null) {
|
||||
response.setStatus(Integer.parseInt(misbehave));
|
||||
|
||||
@@ -205,12 +205,11 @@ public class HttpExchangeTracerTests {
|
||||
@Test
|
||||
public void mixedCaseSetCookieHeaderIsNotIncludedByDefault() {
|
||||
HttpTrace trace = new HttpTrace(createRequest());
|
||||
new HttpExchangeTracer(EnumSet.of(Include.RESPONSE_HEADERS))
|
||||
.sendingResponse(trace,
|
||||
createResponse(Collections.singletonMap(
|
||||
mixedCase(HttpHeaders.SET_COOKIE),
|
||||
Arrays.asList("test=test"))),
|
||||
null, null);
|
||||
new HttpExchangeTracer(EnumSet.of(Include.RESPONSE_HEADERS)).sendingResponse(
|
||||
trace,
|
||||
createResponse(Collections.singletonMap(mixedCase(HttpHeaders.SET_COOKIE),
|
||||
Arrays.asList("test=test"))),
|
||||
null, null);
|
||||
assertThat(trace.getResponse().getHeaders()).isEmpty();
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ public class HttpTraceFilterTests {
|
||||
@Override
|
||||
protected void service(HttpServletRequest req,
|
||||
HttpServletResponse resp)
|
||||
throws ServletException, IOException {
|
||||
throws ServletException, IOException {
|
||||
req.getSession(true);
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ public class HttpTraceFilterTests {
|
||||
@Override
|
||||
protected void service(HttpServletRequest req,
|
||||
HttpServletResponse resp)
|
||||
throws ServletException, IOException {
|
||||
throws ServletException, IOException {
|
||||
throw new IOException();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user