use of org.springframework.boot.actuate.endpoint.web.test.WebEndpointTest in project spring-boot by spring-projects.
the class LoggersEndpointWebIntegrationTests method logLevelForLoggerWithNameThatCouldBeMistakenForAPathExtension.
@WebEndpointTest
void logLevelForLoggerWithNameThatCouldBeMistakenForAPathExtension() {
given(this.loggingSystem.getLoggerConfiguration("com.png")).willReturn(new LoggerConfiguration("com.png", null, LogLevel.DEBUG));
this.client.get().uri("/actuator/loggers/com.png").exchange().expectStatus().isOk().expectBody().jsonPath("$.length()").isEqualTo(2).jsonPath("configuredLevel").isEqualTo(null).jsonPath("effectiveLevel").isEqualTo("DEBUG");
}
use of org.springframework.boot.actuate.endpoint.web.test.WebEndpointTest in project spring-boot by spring-projects.
the class LoggersEndpointWebIntegrationTests method getLoggerShouldReturnLogLevels.
@WebEndpointTest
void getLoggerShouldReturnLogLevels() {
setLogLevelToDebug("test");
given(this.loggingSystem.getLoggerConfiguration("ROOT")).willReturn(new LoggerConfiguration("ROOT", null, LogLevel.DEBUG));
this.client.get().uri("/actuator/loggers/ROOT").exchange().expectStatus().isOk().expectBody().jsonPath("$.length()").isEqualTo(2).jsonPath("configuredLevel").isEqualTo(null).jsonPath("effectiveLevel").isEqualTo("DEBUG");
}
use of org.springframework.boot.actuate.endpoint.web.test.WebEndpointTest in project spring-boot by spring-projects.
the class PrometheusScrapeEndpointIntegrationTests method scrapePrefersToProduceOpenMetrics100.
@WebEndpointTest
void scrapePrefersToProduceOpenMetrics100(WebTestClient client) {
MediaType openMetrics = MediaType.parseMediaType(TextFormat.CONTENT_TYPE_OPENMETRICS_100);
MediaType textPlain = MediaType.parseMediaType(TextFormat.CONTENT_TYPE_004);
client.get().uri("/actuator/prometheus").accept(openMetrics, textPlain).exchange().expectStatus().isOk().expectHeader().contentType(openMetrics);
}
use of org.springframework.boot.actuate.endpoint.web.test.WebEndpointTest in project spring-boot by spring-projects.
the class EnvironmentEndpointWebIntegrationTests method nestedPathMatchedByRegexWhenPlaceholderCannotBeResolvedShouldReturnUnresolvedProperty.
@WebEndpointTest
void nestedPathMatchedByRegexWhenPlaceholderCannotBeResolvedShouldReturnUnresolvedProperty() {
Map<String, Object> map = new HashMap<>();
map.put("my.foo", "${my.bar}");
this.context.getEnvironment().getPropertySources().addFirst(new MapPropertySource("unresolved-placeholder", map));
this.client.get().uri("/actuator/env?pattern=my.*").exchange().expectStatus().isOk().expectBody().jsonPath("propertySources[?(@.name=='unresolved-placeholder')].properties.['my.foo'].value").isEqualTo("${my.bar}");
}
use of org.springframework.boot.actuate.endpoint.web.test.WebEndpointTest in project spring-boot by spring-projects.
the class EnvironmentEndpointWebIntegrationTests method nestedPathWithSensitivePlaceholderShouldSanitize.
@WebEndpointTest
void nestedPathWithSensitivePlaceholderShouldSanitize() {
Map<String, Object> map = new HashMap<>();
map.put("my.foo", "${my.password}");
map.put("my.password", "hello");
this.context.getEnvironment().getPropertySources().addFirst(new MapPropertySource("placeholder", map));
this.client.get().uri("/actuator/env/my.foo").exchange().expectStatus().isOk().expectBody().jsonPath("property.value").isEqualTo("******").jsonPath(forPropertyEntry("placeholder")).isEqualTo("******");
}
Aggregations