commit
1e43b0003f
|
@ -1926,7 +1926,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "management.metrics.graphql.autotime.enabled",
|
"name": "management.metrics.graphql.autotime.enabled",
|
||||||
"description": "Whether to automatically time GraphQL requests.",
|
"description": "Whether to automatically time web client requests.",
|
||||||
"defaultValue": true,
|
"defaultValue": true,
|
||||||
"deprecation": {
|
"deprecation": {
|
||||||
"level": "error",
|
"level": "error",
|
||||||
|
|
|
@ -117,9 +117,11 @@ class OnPropertyCondition extends SpringBootCondition {
|
||||||
private String[] getNames(AnnotationAttributes annotationAttributes) {
|
private String[] getNames(AnnotationAttributes annotationAttributes) {
|
||||||
String[] value = (String[]) annotationAttributes.get("value");
|
String[] value = (String[]) annotationAttributes.get("value");
|
||||||
String[] name = (String[]) annotationAttributes.get("name");
|
String[] name = (String[]) annotationAttributes.get("name");
|
||||||
Assert.state(value.length > 0 || name.length > 0, "The name or value attribute of @%s must be specified"
|
Assert.state(value.length > 0 || name.length > 0,
|
||||||
|
() -> "The name or value attribute of @%s must be specified"
|
||||||
.formatted(ClassUtils.getShortName(this.annotationType)));
|
.formatted(ClassUtils.getShortName(this.annotationType)));
|
||||||
Assert.state(value.length == 0 || name.length == 0, "The name and value attributes of @%s are exclusive"
|
Assert.state(value.length == 0 || name.length == 0,
|
||||||
|
() -> "The name and value attributes of @%s are exclusive"
|
||||||
.formatted(ClassUtils.getShortName(this.annotationType)));
|
.formatted(ClassUtils.getShortName(this.annotationType)));
|
||||||
return (value.length > 0) ? value : name;
|
return (value.length > 0) ? value : name;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2492,13 +2492,6 @@ bom {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
library("WebJars Locator Lite", "1.0.1") {
|
|
||||||
group("org.webjars") {
|
|
||||||
modules = [
|
|
||||||
"webjars-locator-lite"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
library("WebJars Locator Core", "0.59") {
|
library("WebJars Locator Core", "0.59") {
|
||||||
group("org.webjars") {
|
group("org.webjars") {
|
||||||
modules = [
|
modules = [
|
||||||
|
@ -2506,6 +2499,13 @@ bom {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
library("WebJars Locator Lite", "1.0.1") {
|
||||||
|
group("org.webjars") {
|
||||||
|
modules = [
|
||||||
|
"webjars-locator-lite"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
library("WSDL4j", "1.6.3") {
|
library("WSDL4j", "1.6.3") {
|
||||||
group("wsdl4j") {
|
group("wsdl4j") {
|
||||||
modules = [
|
modules = [
|
||||||
|
|
|
@ -84,7 +84,7 @@ class PostgresJdbcDockerComposeConnectionDetailsFactoryIntegrationTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private <T> T executeQuery(JdbcConnectionDetails connectionDetails, String sql, Class<T> result)
|
private <T> T executeQuery(JdbcConnectionDetails connectionDetails, String sql, Class<T> resultClass)
|
||||||
throws ClassNotFoundException {
|
throws ClassNotFoundException {
|
||||||
SimpleDriverDataSource dataSource = new SimpleDriverDataSource();
|
SimpleDriverDataSource dataSource = new SimpleDriverDataSource();
|
||||||
dataSource.setUrl(connectionDetails.getJdbcUrl());
|
dataSource.setUrl(connectionDetails.getJdbcUrl());
|
||||||
|
@ -92,7 +92,7 @@ class PostgresJdbcDockerComposeConnectionDetailsFactoryIntegrationTests {
|
||||||
dataSource.setPassword(connectionDetails.getPassword());
|
dataSource.setPassword(connectionDetails.getPassword());
|
||||||
dataSource.setDriverClass((Class<? extends Driver>) ClassUtils.forName(connectionDetails.getDriverClassName(),
|
dataSource.setDriverClass((Class<? extends Driver>) ClassUtils.forName(connectionDetails.getDriverClassName(),
|
||||||
getClass().getClassLoader()));
|
getClass().getClassLoader()));
|
||||||
return new JdbcTemplate(dataSource).queryForObject(sql, result);
|
return new JdbcTemplate(dataSource).queryForObject(sql, resultClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,11 +88,11 @@ class PostgresR2dbcDockerComposeConnectionDetailsFactoryIntegrationTests {
|
||||||
.isEqualTo(1);
|
.isEqualTo(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <T> T executeQuery(R2dbcConnectionDetails connectionDetails, String sql, Class<T> result) {
|
private <T> T executeQuery(R2dbcConnectionDetails connectionDetails, String sql, Class<T> resultClass) {
|
||||||
ConnectionFactoryOptions connectionFactoryOptions = connectionDetails.getConnectionFactoryOptions();
|
ConnectionFactoryOptions connectionFactoryOptions = connectionDetails.getConnectionFactoryOptions();
|
||||||
return DatabaseClient.create(ConnectionFactories.get(connectionFactoryOptions))
|
return DatabaseClient.create(ConnectionFactories.get(connectionFactoryOptions))
|
||||||
.sql(sql)
|
.sql(sql)
|
||||||
.mapValue(result)
|
.mapValue(resultClass)
|
||||||
.first()
|
.first()
|
||||||
.block(Duration.ofSeconds(30));
|
.block(Duration.ofSeconds(30));
|
||||||
}
|
}
|
||||||
|
|
|
@ -276,7 +276,7 @@ abstract sealed class DockerCliCommand<R> {
|
||||||
*/
|
*/
|
||||||
record ComposeVersion(int major, int minor) {
|
record ComposeVersion(int major, int minor) {
|
||||||
|
|
||||||
public static final ComposeVersion UNKNOWN = new ComposeVersion(0, 0);
|
static final ComposeVersion UNKNOWN = new ComposeVersion(0, 0);
|
||||||
|
|
||||||
boolean isLessThan(int major, int minor) {
|
boolean isLessThan(int major, int minor) {
|
||||||
return major() < major || major() == major && minor() < minor;
|
return major() < major || major() == major && minor() < minor;
|
||||||
|
|
|
@ -377,7 +377,7 @@ NOTE: Using a javadoc:org.springframework.boot.testcontainers.service.connection
|
||||||
|
|
||||||
|
|
||||||
[[features.dev-services.testcontainers.at-development-time.importing-container-declarations]]
|
[[features.dev-services.testcontainers.at-development-time.importing-container-declarations]]
|
||||||
==== Importing Testcontainer Declaration Classes
|
==== Importing Testcontainers Declaration Classes
|
||||||
|
|
||||||
A common pattern when using Testcontainers is to declare javadoc:org.testcontainers.containers.Container[] instances as static fields.
|
A common pattern when using Testcontainers is to declare javadoc:org.testcontainers.containers.Container[] instances as static fields.
|
||||||
Often these fields are defined directly on the test class.
|
Often these fields are defined directly on the test class.
|
||||||
|
@ -402,7 +402,7 @@ You can also add javadoc:org.springframework.test.context.DynamicPropertySource[
|
||||||
|
|
||||||
When using devtools, you can annotate beans and bean methods with javadoc:org.springframework.boot.devtools.restart.RestartScope[format=annotation].
|
When using devtools, you can annotate beans and bean methods with javadoc:org.springframework.boot.devtools.restart.RestartScope[format=annotation].
|
||||||
Such beans won't be recreated when the devtools restart the application.
|
Such beans won't be recreated when the devtools restart the application.
|
||||||
This is especially useful for Testcontainer javadoc:org.testcontainers.containers.Container[] beans, as they keep their state despite the application restart.
|
This is especially useful for javadoc:org.testcontainers.containers.Container[] beans, as they keep their state despite the application restart.
|
||||||
|
|
||||||
include-code::MyContainersConfiguration[]
|
include-code::MyContainersConfiguration[]
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ public @interface AutoConfigureTestDatabase {
|
||||||
* databases:
|
* databases:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>Any bean definition that includes {@link ContainerImageMetadata} (including
|
* <li>Any bean definition that includes {@link ContainerImageMetadata} (including
|
||||||
* {@code @ServiceConnection} annotated Testcontainer databases, and connections
|
* {@code @ServiceConnection} annotated Testcontainers databases, and connections
|
||||||
* created using Docker Compose)</li>
|
* created using Docker Compose)</li>
|
||||||
* <li>Any connection configured using a {@code spring.datasource.url} backed by a
|
* <li>Any connection configured using a {@code spring.datasource.url} backed by a
|
||||||
* {@link DynamicPropertySource @DynamicPropertySource}</li>
|
* {@link DynamicPropertySource @DynamicPropertySource}</li>
|
||||||
|
|
|
@ -155,7 +155,7 @@ class TestRestTemplateTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void httpComponentsAreBuildConsideringSettingsInRestTemplateBuilder() {
|
void httpComponentsAreBuiltConsideringSettingsInRestTemplateBuilder() {
|
||||||
RestTemplateBuilder builder = new RestTemplateBuilder()
|
RestTemplateBuilder builder = new RestTemplateBuilder()
|
||||||
.requestFactoryBuilder(ClientHttpRequestFactoryBuilder.httpComponents());
|
.requestFactoryBuilder(ClientHttpRequestFactoryBuilder.httpComponents());
|
||||||
assertThat(getRequestConfig((RestTemplateBuilder) null).isRedirectsEnabled()).isFalse();
|
assertThat(getRequestConfig((RestTemplateBuilder) null).isRedirectsEnabled()).isFalse();
|
||||||
|
@ -209,9 +209,8 @@ class TestRestTemplateTests {
|
||||||
return factory.createRequestConfig();
|
return factory.createRequestConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
private HttpClient getJdkHttpClient(TestRestTemplate templateWithRedirects) {
|
private HttpClient getJdkHttpClient(TestRestTemplate template) {
|
||||||
JdkClientHttpRequestFactory requestFactory = (JdkClientHttpRequestFactory) templateWithRedirects
|
JdkClientHttpRequestFactory requestFactory = (JdkClientHttpRequestFactory) template.getRestTemplate()
|
||||||
.getRestTemplate()
|
|
||||||
.getRequestFactory();
|
.getRequestFactory();
|
||||||
return (HttpClient) ReflectionTestUtils.getField(requestFactory, "httpClient");
|
return (HttpClient) ReflectionTestUtils.getField(requestFactory, "httpClient");
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||||
*/
|
*/
|
||||||
@SpringJUnitConfig
|
@SpringJUnitConfig
|
||||||
@Testcontainers(disabledWithoutDocker = true)
|
@Testcontainers(disabledWithoutDocker = true)
|
||||||
class ServiceConnectionStartsConnectionOnceIntegrationTest {
|
class ServiceConnectionStartsConnectionOnceIntegrationTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
@ServiceConnection
|
@ServiceConnection
|
|
@ -30,7 +30,7 @@ import org.springframework.context.ApplicationContext;
|
||||||
import org.springframework.context.annotation.Import;
|
import org.springframework.context.annotation.Import;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Imports idiomatic Testcontainer declaration classes into the Spring
|
* Imports idiomatic Testcontainers declaration classes into the Spring
|
||||||
* {@link ApplicationContext}. The following elements will be considered from the imported
|
* {@link ApplicationContext}. The following elements will be considered from the imported
|
||||||
* classes:
|
* classes:
|
||||||
* <ul>
|
* <ul>
|
||||||
|
|
|
@ -39,13 +39,13 @@ abstract class ProgressUpdateEventTests<E extends ProgressUpdateEvent> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void getProgressDetailsReturnsProgressDetails() {
|
void getProgressDetailReturnsProgressDetails() {
|
||||||
ProgressUpdateEvent event = createEvent();
|
ProgressUpdateEvent event = createEvent();
|
||||||
assertThat(event.getProgressDetail().asPercentage()).isEqualTo(50);
|
assertThat(event.getProgressDetail().asPercentage()).isEqualTo(50);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void getProgressDetailsReturnsProgressDetailsForLongNumbers() {
|
void getProgressDetailReturnsProgressDetailsForLongNumbers() {
|
||||||
ProgressUpdateEvent event = createEvent("status", new ProgressDetail(4000000000L, 8000000000L), "progress");
|
ProgressUpdateEvent event = createEvent("status", new ProgressDetail(4000000000L, 8000000000L), "progress");
|
||||||
assertThat(event.getProgressDetail().asPercentage()).isEqualTo(50);
|
assertThat(event.getProgressDetail().asPercentage()).isEqualTo(50);
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ import org.springframework.util.StringUtils;
|
||||||
* <li>Apache DBCP2 ({@code org.apache.commons.dbcp2.BasicDataSource})</li>
|
* <li>Apache DBCP2 ({@code org.apache.commons.dbcp2.BasicDataSource})</li>
|
||||||
* <li>Oracle UCP ({@code oracle.ucp.jdbc.PoolDataSourceImpl})</li>
|
* <li>Oracle UCP ({@code oracle.ucp.jdbc.PoolDataSourceImpl})</li>
|
||||||
* <li>C3P0 ({@code com.mchange.v2.c3p0.ComboPooledDataSource})</li>
|
* <li>C3P0 ({@code com.mchange.v2.c3p0.ComboPooledDataSource})</li>
|
||||||
* <li>Vibur {@code org.vibur.dbcp.ViburDBCPDataSource}</li>
|
* <li>Vibur ({@code org.vibur.dbcp.ViburDBCPDataSource})</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* <p>
|
* <p>
|
||||||
* The following non-pooling {@link DataSource} implementations can be used when
|
* The following non-pooling {@link DataSource} implementations can be used when
|
||||||
|
|
|
@ -34,7 +34,7 @@ public final class ConnectionFactoryUnwrapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the native {@link ConnectionFactory} by unwrapping ot from a
|
* Return the native {@link ConnectionFactory} by unwrapping from a
|
||||||
* {@link CachingConnectionFactory}. Return the given {@link ConnectionFactory} if no
|
* {@link CachingConnectionFactory}. Return the given {@link ConnectionFactory} if no
|
||||||
* {@link CachingConnectionFactory} wrapper has been detected.
|
* {@link CachingConnectionFactory} wrapper has been detected.
|
||||||
* @param connectionFactory a connection factory
|
* @param connectionFactory a connection factory
|
||||||
|
|
|
@ -142,8 +142,7 @@ public enum LoggingSystemProperty {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the name of the application property name that can be used to set this
|
* Return the application property name that can be used to set this property.
|
||||||
* property.
|
|
||||||
* @return the application property name
|
* @return the application property name
|
||||||
* @since 3.4.0
|
* @since 3.4.0
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -228,8 +228,8 @@ public class Log4J2LoggingSystem extends AbstractLoggingSystem {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reset the stream used by the fallback listener to the current system out. This
|
* Reset the stream used by the fallback listener to the current system out. This
|
||||||
* allows the fallback lister to work with any captured output streams in a similar
|
* allows the fallback listener to work with any captured output streams in a similar
|
||||||
* way to the {@code follow} attribute of the {@code literal Console} appender.
|
* way to the {@code follow} attribute of the {@code Console} appender.
|
||||||
* @param statusLogger the status logger to update
|
* @param statusLogger the status logger to update
|
||||||
*/
|
*/
|
||||||
private void resetFallbackListenerStream(StatusLogger statusLogger) {
|
private void resetFallbackListenerStream(StatusLogger statusLogger) {
|
||||||
|
|
|
@ -47,13 +47,13 @@ class DebugLogbackConfigurator extends LogbackConfigurator {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void appender(String name, Appender<?> appender) {
|
void appender(String name, Appender<?> appender) {
|
||||||
info("Adding appender '" + appender + "' named '" + name + "'");
|
info("Adding appender '" + appender + "' named '" + name + "'");
|
||||||
super.appender(name, appender);
|
super.appender(name, appender);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void logger(String name, Level level, boolean additive, Appender<ILoggingEvent> appender) {
|
void logger(String name, Level level, boolean additive, Appender<ILoggingEvent> appender) {
|
||||||
info("Configuring logger '" + name + "' with level '" + level + "'. Additive: " + additive);
|
info("Configuring logger '" + name + "' with level '" + level + "'. Additive: " + additive);
|
||||||
if (appender != null) {
|
if (appender != null) {
|
||||||
info("Adding appender '" + appender + "' to logger '" + name + "'");
|
info("Adding appender '" + appender + "' to logger '" + name + "'");
|
||||||
|
@ -62,7 +62,7 @@ class DebugLogbackConfigurator extends LogbackConfigurator {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start(LifeCycle lifeCycle) {
|
void start(LifeCycle lifeCycle) {
|
||||||
info("Starting '" + lifeCycle + "'");
|
info("Starting '" + lifeCycle + "'");
|
||||||
super.start(lifeCycle);
|
super.start(lifeCycle);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ class FilteringStatusListener extends ContextAwareBase implements StatusListener
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new {@link FilteringStatusListener}.
|
* Creates a new {@link FilteringStatusListener}.
|
||||||
* @param delegate the {@link StatusListener} delegate to
|
* @param delegate the {@link StatusListener} to delegate to
|
||||||
* @param levelThreshold the minimum log level accepted for delegation
|
* @param levelThreshold the minimum log level accepted for delegation
|
||||||
*/
|
*/
|
||||||
FilteringStatusListener(StatusListener delegate, int levelThreshold) {
|
FilteringStatusListener(StatusListener delegate, int levelThreshold) {
|
||||||
|
|
|
@ -52,7 +52,7 @@ class FilteringStatusListenerTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void shouldStartUnderlyingStatusListener() {
|
void shouldStartUnderlyingStatusListener() {
|
||||||
FilteringStatusListener listener = createListener(Status.INFO);
|
FilteringStatusListener listener = createListener();
|
||||||
assertThat(this.delegate.isStarted()).isFalse();
|
assertThat(this.delegate.isStarted()).isFalse();
|
||||||
listener.start();
|
listener.start();
|
||||||
assertThat(this.delegate.isStarted()).isTrue();
|
assertThat(this.delegate.isStarted()).isTrue();
|
||||||
|
|
Loading…
Reference in New Issue