Merge branch '3.3.x'
Closes gh-41616
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -29,13 +29,13 @@ import org.springframework.boot.test.web.client.MockServerRestClientCustomizer;
|
||||
import org.springframework.boot.test.web.client.MockServerRestTemplateCustomizer;
|
||||
import org.springframework.boot.web.client.RestTemplateBuilder;
|
||||
import org.springframework.test.web.client.MockRestServiceServer;
|
||||
import org.springframework.web.client.RestClient;
|
||||
import org.springframework.web.client.RestClient.Builder;
|
||||
|
||||
/**
|
||||
* Annotation that can be applied to a test class to enable and configure
|
||||
* auto-configuration of a single {@link MockRestServiceServer}. Only useful when a single
|
||||
* call is made to {@link RestTemplateBuilder} or {@link RestClient.Builder}. If multiple
|
||||
* {@link org.springframework.web.client.RestTemplate RestTemplates} or
|
||||
* call is made to {@link RestTemplateBuilder} or {@link Builder RestClient.Builder}. If
|
||||
* multiple {@link org.springframework.web.client.RestTemplate RestTemplates} or
|
||||
* {@link org.springframework.web.client.RestClient RestClients} are in use, inject a
|
||||
* {@link MockServerRestTemplateCustomizer} and use
|
||||
* {@link MockServerRestTemplateCustomizer#getServer(org.springframework.web.client.RestTemplate)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -38,12 +38,12 @@ import org.springframework.stereotype.Component;
|
||||
import org.springframework.test.context.BootstrapWith;
|
||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||
import org.springframework.test.web.client.MockRestServiceServer;
|
||||
import org.springframework.web.client.RestClient;
|
||||
import org.springframework.web.client.RestClient.Builder;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
/**
|
||||
* Annotation for a Spring rest client test that focuses <strong>only</strong> on beans
|
||||
* that use {@link RestTemplateBuilder} or {@link RestClient.Builder}.
|
||||
* that use {@link RestTemplateBuilder} or {@link Builder RestClient.Builder}.
|
||||
* <p>
|
||||
* Using this annotation will disable full auto-configuration and instead apply only
|
||||
* configuration relevant to rest client tests (i.e. Jackson or GSON auto-configuration
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -40,7 +40,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class ConditionReportApplicationContextFailureProcessorTests {
|
||||
|
||||
@Test
|
||||
void loadFailureShouldPrintReport(CapturedOutput output) throws Exception {
|
||||
void loadFailureShouldPrintReport(CapturedOutput output) {
|
||||
SpringApplication application = new SpringApplication(TestConfig.class);
|
||||
application.setWebApplicationType(WebApplicationType.NONE);
|
||||
ConfigurableApplicationContext applicationContext = application.run();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,7 +20,6 @@ import java.util.Collections;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.context.ApplicationContextInitializer;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.support.GenericApplicationContext;
|
||||
import org.springframework.mock.env.MockEnvironment;
|
||||
@@ -148,11 +147,6 @@ class ObservabilityContextCustomizerFactoryTests {
|
||||
return contextCustomizer;
|
||||
}
|
||||
|
||||
private ApplicationContextInitializer<ConfigurableApplicationContext> applyCustomizer(
|
||||
ContextCustomizer customizer) {
|
||||
return (applicationContext) -> customizer.customizeContext(applicationContext, null);
|
||||
}
|
||||
|
||||
private void assertThatTracingIsDisabled(ConfigurableApplicationContext context) {
|
||||
assertThat(context.getEnvironment().getProperty("management.tracing.enabled")).isEqualTo("false");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user