Merge pull request #35185 from izeye

* pr/35185:
  Polish

Closes gh-35185
This commit is contained in:
Moritz Halbritter 2023-05-10 08:31:46 +02:00
commit cb2773da21
12 changed files with 21 additions and 21 deletions

View File

@ -45,7 +45,7 @@ public class OtlpProperties {
private Duration timeout = Duration.ofSeconds(10);
/**
* The method used to compress the payload.
* Method used to compress the payload.
*/
private Compression compression = Compression.NONE;

View File

@ -67,7 +67,7 @@ class OtlpAutoConfigurationIntegrationTests {
}
@Test
void httpSpanExporterShouldUseProtoBufAndNoCompressionByDefault() {
void httpSpanExporterShouldUseProtobufAndNoCompressionByDefault() {
this.mockWebServer.enqueue(new MockResponse());
this.contextRunner
.withPropertyValues("management.otlp.tracing.endpoint=http://localhost:%d/v1/traces"
@ -105,9 +105,9 @@ class OtlpAutoConfigurationIntegrationTests {
assertThat(request.getHeader("Content-Type")).isEqualTo("application/x-protobuf");
assertThat(request.getHeader("Content-Encoding")).isEqualTo("gzip");
assertThat(request.getBodySize()).isPositive();
try (Buffer unCompressed = new Buffer(); Buffer body = request.getBody()) {
unCompressed.writeAll(new GzipSource(body));
assertThat(unCompressed.readString(StandardCharsets.UTF_8)).contains("org.springframework.boot");
try (Buffer uncompressed = new Buffer(); Buffer body = request.getBody()) {
uncompressed.writeAll(new GzipSource(body));
assertThat(uncompressed.readString(StandardCharsets.UTF_8)).contains("org.springframework.boot");
}
});
}

View File

@ -59,7 +59,7 @@ import org.springframework.util.StringUtils;
/**
* {@link ApplicationRunner} to {@link JobLauncher launch} Spring Batch jobs. If a single
* job is found in the context, it will be executed by default. If multiple jobs are
* found, launch a specific job by providing a jobName
* found, launch a specific job by providing a jobName.
*
* @author Dave Syer
* @author Jean-Pierre Bergamin

View File

@ -97,7 +97,6 @@ class JmxAutoConfigurationTests {
"namingStrategy");
assertThat(naming).hasFieldOrPropertyWithValue("defaultDomain", "my-test-domain");
assertThat(naming).hasFieldOrPropertyWithValue("ensureUniqueRuntimeObjectNames", true);
});
}

View File

@ -30,8 +30,8 @@ NOTE: There's an added logger statement in the `home()` method, which will be im
Now we have to add the following dependencies:
* `org.springframework.boot:spring-boot-starter-actuator`
* `io.micrometer:micrometer-tracing-bridge-otel` - which is needed to bridge the Micrometer Observation API to OpenTelemetry.
* `io.opentelemetry:opentelemetry-exporter-zipkin` - which is needed to report https://micrometer.io/docs/tracing#_glossary[traces] to Zipkin.
* `io.micrometer:micrometer-tracing-bridge-otel` - bridges the Micrometer Observation API to OpenTelemetry.
* `io.opentelemetry:opentelemetry-exporter-zipkin` - reports https://micrometer.io/docs/tracing#_glossary[traces] to Zipkin.
Add the following application properties:
@ -101,7 +101,7 @@ Use the `management.wavefront.*` configuration properties to configure reporting
Tracing with OpenTelemetry and reporting using OTLP requires the following dependencies:
* `io.micrometer:micrometer-tracing-bridge-otel` - bridges the Micrometer Observation API to OpenTelemetry.
* `io.opentelemetry:opentelemetry-exporter-otlp` - report traces to a collector that can accept OTLP.
* `io.opentelemetry:opentelemetry-exporter-otlp` - reports traces to a collector that can accept OTLP.
Use the `management.otlp.tracing.*` configuration properties to configure reporting using OTLP.
@ -124,8 +124,8 @@ Use the `management.zipkin.tracing.*` configuration properties to configure repo
==== OpenZipkin Brave With Wavefront
Tracing with OpenZipkin Brave and reporting to Wavefront requires the following dependencies:
* `io.micrometer:micrometer-tracing-bridge-brave` - which is needed to bridge the Micrometer Observation API to Brave.
* `io.micrometer:micrometer-tracing-reporter-wavefront` - which is needed to report traces to Wavefront.
* `io.micrometer:micrometer-tracing-bridge-brave` - bridges the Micrometer Observation API to Brave.
* `io.micrometer:micrometer-tracing-reporter-wavefront` - reports traces to Wavefront.
Use the `management.wavefront.*` configuration properties to configure reporting to Wavefront.

View File

@ -21,7 +21,7 @@ import java.util.TimeZone;
import java.util.zip.ZipEntry;
/**
* Utility class that can be used change a UTC time based on the
* Utility class that can be used to change a UTC time based on the
* {@link java.util.TimeZone#getDefault() default TimeZone}. This is required because
* {@link ZipEntry#setTime(long)} expects times in the default timezone and not UTC.
*

View File

@ -21,7 +21,7 @@ import java.util.TimeZone;
import java.util.zip.ZipEntry;
/**
* Utility class that can be used change a UTC time based on the
* Utility class that can be used to change a UTC time based on the
* {@link java.util.TimeZone#getDefault() default TimeZone}. This is required because
* {@link ZipEntry#setTime(long)} expects times in the default timezone and not UTC.
*

View File

@ -29,6 +29,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
* Disables test execution if a process is unavailable.
*
* @author Phillip Webb
* @since 3.1.0
*/
@Target({ ElementType.TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)

View File

@ -57,8 +57,8 @@ class DisabledIfProcessUnavailableCondition implements ExecutionCondition {
}
}
private Stream<String[]> getAnnotationValue(AnnotatedElement testClass) {
return MergedAnnotations.from(testClass, SearchStrategy.TYPE_HIERARCHY)
private Stream<String[]> getAnnotationValue(AnnotatedElement testElement) {
return MergedAnnotations.from(testElement, SearchStrategy.TYPE_HIERARCHY)
.stream(DisabledIfProcessUnavailable.class)
.map((annotation) -> annotation.getStringArray(MergedAnnotation.VALUE));
}

View File

@ -25,9 +25,10 @@ import java.lang.annotation.Target;
import org.junit.jupiter.api.extension.ExtendWith;
/**
* Repeatable container for {@link DisabledIfProcessUnavailables}.
* Repeatable container for {@link DisabledIfProcessUnavailable}.
*
* @author Phillip Webb
* @since 3.1.0
*/
@Target({ ElementType.TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)

View File

@ -1364,8 +1364,8 @@ public class SpringApplication {
* writing a test harness that needs to start an application with additional
* configuration.
* @param main the main method entry point that runs the {@link SpringApplication}
* @return an {@link SpringApplication.Augmented} instance that can be used to add
* configuration and run the application.
* @return a {@link SpringApplication.Augmented} instance that can be used to add
* configuration and run the application
* @since 3.1.0
* @see #withHook(SpringApplicationHook, Runnable)
*/

View File

@ -102,7 +102,6 @@ class DefaultBindConstructorProvider implements BindConstructorProvider {
boolean hasAutowiredConstructor = isAutowiredPresent(type);
Constructor<?>[] candidates = getCandidateConstructors(type);
MergedAnnotations[] candidateAnnotations = getAnnotations(candidates);
boolean kotlinType = isKotlinType(type);
boolean deducedBindConstructor = false;
boolean immutableType = type.isRecord();
Constructor<?> bind = getConstructorBindingAnnotated(type, candidates, candidateAnnotations);
@ -110,7 +109,7 @@ class DefaultBindConstructorProvider implements BindConstructorProvider {
bind = deduceBindConstructor(type, candidates);
deducedBindConstructor = bind != null;
}
if (bind == null && !hasAutowiredConstructor && kotlinType) {
if (bind == null && !hasAutowiredConstructor && isKotlinType(type)) {
bind = deduceKotlinBindConstructor(type);
deducedBindConstructor = bind != null;
}