See gh-35185
pull/35417/head
Johnny Lim 2 years ago committed by Moritz Halbritter
parent 394fb6424c
commit ff9fd1abeb

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

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

@ -59,7 +59,7 @@ import org.springframework.util.StringUtils;
/** /**
* {@link ApplicationRunner} to {@link JobLauncher launch} Spring Batch jobs. If a single * {@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 * 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 Dave Syer
* @author Jean-Pierre Bergamin * @author Jean-Pierre Bergamin

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

@ -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: Now we have to add the following dependencies:
* `org.springframework.boot:spring-boot-starter-actuator` * `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.micrometer:micrometer-tracing-bridge-otel` - bridges 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.opentelemetry:opentelemetry-exporter-zipkin` - reports https://micrometer.io/docs/tracing#_glossary[traces] to Zipkin.
Add the following application properties: 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: 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.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. 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 ==== OpenZipkin Brave With Wavefront
Tracing with OpenZipkin Brave and reporting to Wavefront requires the following dependencies: 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-bridge-brave` - bridges the Micrometer Observation API to Brave.
* `io.micrometer:micrometer-tracing-reporter-wavefront` - which is needed to report traces to Wavefront. * `io.micrometer:micrometer-tracing-reporter-wavefront` - reports traces to Wavefront.
Use the `management.wavefront.*` configuration properties to configure reporting to Wavefront. Use the `management.wavefront.*` configuration properties to configure reporting to Wavefront.

@ -21,7 +21,7 @@ import java.util.TimeZone;
import java.util.zip.ZipEntry; 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 java.util.TimeZone#getDefault() default TimeZone}. This is required because
* {@link ZipEntry#setTime(long)} expects times in the default timezone and not UTC. * {@link ZipEntry#setTime(long)} expects times in the default timezone and not UTC.
* *

@ -21,7 +21,7 @@ import java.util.TimeZone;
import java.util.zip.ZipEntry; 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 java.util.TimeZone#getDefault() default TimeZone}. This is required because
* {@link ZipEntry#setTime(long)} expects times in the default timezone and not UTC. * {@link ZipEntry#setTime(long)} expects times in the default timezone and not UTC.
* *

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

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

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

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

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

Loading…
Cancel
Save