commit
1e43b0003f
|
@ -1926,7 +1926,7 @@
|
|||
},
|
||||
{
|
||||
"name": "management.metrics.graphql.autotime.enabled",
|
||||
"description": "Whether to automatically time GraphQL requests.",
|
||||
"description": "Whether to automatically time web client requests.",
|
||||
"defaultValue": true,
|
||||
"deprecation": {
|
||||
"level": "error",
|
||||
|
|
|
@ -117,10 +117,12 @@ class OnPropertyCondition extends SpringBootCondition {
|
|||
private String[] getNames(AnnotationAttributes annotationAttributes) {
|
||||
String[] value = (String[]) annotationAttributes.get("value");
|
||||
String[] name = (String[]) annotationAttributes.get("name");
|
||||
Assert.state(value.length > 0 || name.length > 0, "The name or value attribute of @%s must be specified"
|
||||
.formatted(ClassUtils.getShortName(this.annotationType)));
|
||||
Assert.state(value.length == 0 || name.length == 0, "The name and value attributes of @%s are exclusive"
|
||||
.formatted(ClassUtils.getShortName(this.annotationType)));
|
||||
Assert.state(value.length > 0 || name.length > 0,
|
||||
() -> "The name or value attribute of @%s must be specified"
|
||||
.formatted(ClassUtils.getShortName(this.annotationType)));
|
||||
Assert.state(value.length == 0 || name.length == 0,
|
||||
() -> "The name and value attributes of @%s are exclusive"
|
||||
.formatted(ClassUtils.getShortName(this.annotationType)));
|
||||
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") {
|
||||
group("org.webjars") {
|
||||
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") {
|
||||
group("wsdl4j") {
|
||||
modules = [
|
||||
|
|
|
@ -84,7 +84,7 @@ class PostgresJdbcDockerComposeConnectionDetailsFactoryIntegrationTests {
|
|||
}
|
||||
|
||||
@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 {
|
||||
SimpleDriverDataSource dataSource = new SimpleDriverDataSource();
|
||||
dataSource.setUrl(connectionDetails.getJdbcUrl());
|
||||
|
@ -92,7 +92,7 @@ class PostgresJdbcDockerComposeConnectionDetailsFactoryIntegrationTests {
|
|||
dataSource.setPassword(connectionDetails.getPassword());
|
||||
dataSource.setDriverClass((Class<? extends Driver>) ClassUtils.forName(connectionDetails.getDriverClassName(),
|
||||
getClass().getClassLoader()));
|
||||
return new JdbcTemplate(dataSource).queryForObject(sql, result);
|
||||
return new JdbcTemplate(dataSource).queryForObject(sql, resultClass);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -88,11 +88,11 @@ class PostgresR2dbcDockerComposeConnectionDetailsFactoryIntegrationTests {
|
|||
.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();
|
||||
return DatabaseClient.create(ConnectionFactories.get(connectionFactoryOptions))
|
||||
.sql(sql)
|
||||
.mapValue(result)
|
||||
.mapValue(resultClass)
|
||||
.first()
|
||||
.block(Duration.ofSeconds(30));
|
||||
}
|
||||
|
|
|
@ -276,7 +276,7 @@ abstract sealed class DockerCliCommand<R> {
|
|||
*/
|
||||
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) {
|
||||
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]]
|
||||
==== 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.
|
||||
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].
|
||||
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[]
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ public @interface AutoConfigureTestDatabase {
|
|||
* databases:
|
||||
* <ul>
|
||||
* <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>
|
||||
* <li>Any connection configured using a {@code spring.datasource.url} backed by a
|
||||
* {@link DynamicPropertySource @DynamicPropertySource}</li>
|
||||
|
|
|
@ -155,7 +155,7 @@ class TestRestTemplateTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
void httpComponentsAreBuildConsideringSettingsInRestTemplateBuilder() {
|
||||
void httpComponentsAreBuiltConsideringSettingsInRestTemplateBuilder() {
|
||||
RestTemplateBuilder builder = new RestTemplateBuilder()
|
||||
.requestFactoryBuilder(ClientHttpRequestFactoryBuilder.httpComponents());
|
||||
assertThat(getRequestConfig((RestTemplateBuilder) null).isRedirectsEnabled()).isFalse();
|
||||
|
@ -209,9 +209,8 @@ class TestRestTemplateTests {
|
|||
return factory.createRequestConfig();
|
||||
}
|
||||
|
||||
private HttpClient getJdkHttpClient(TestRestTemplate templateWithRedirects) {
|
||||
JdkClientHttpRequestFactory requestFactory = (JdkClientHttpRequestFactory) templateWithRedirects
|
||||
.getRestTemplate()
|
||||
private HttpClient getJdkHttpClient(TestRestTemplate template) {
|
||||
JdkClientHttpRequestFactory requestFactory = (JdkClientHttpRequestFactory) template.getRestTemplate()
|
||||
.getRequestFactory();
|
||||
return (HttpClient) ReflectionTestUtils.getField(requestFactory, "httpClient");
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
*/
|
||||
@SpringJUnitConfig
|
||||
@Testcontainers(disabledWithoutDocker = true)
|
||||
class ServiceConnectionStartsConnectionOnceIntegrationTest {
|
||||
class ServiceConnectionStartsConnectionOnceIntegrationTests {
|
||||
|
||||
@Container
|
||||
@ServiceConnection
|
|
@ -30,7 +30,7 @@ import org.springframework.context.ApplicationContext;
|
|||
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
|
||||
* classes:
|
||||
* <ul>
|
||||
|
|
|
@ -39,13 +39,13 @@ abstract class ProgressUpdateEventTests<E extends ProgressUpdateEvent> {
|
|||
}
|
||||
|
||||
@Test
|
||||
void getProgressDetailsReturnsProgressDetails() {
|
||||
void getProgressDetailReturnsProgressDetails() {
|
||||
ProgressUpdateEvent event = createEvent();
|
||||
assertThat(event.getProgressDetail().asPercentage()).isEqualTo(50);
|
||||
}
|
||||
|
||||
@Test
|
||||
void getProgressDetailsReturnsProgressDetailsForLongNumbers() {
|
||||
void getProgressDetailReturnsProgressDetailsForLongNumbers() {
|
||||
ProgressUpdateEvent event = createEvent("status", new ProgressDetail(4000000000L, 8000000000L), "progress");
|
||||
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>Oracle UCP ({@code oracle.ucp.jdbc.PoolDataSourceImpl})</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>
|
||||
* <p>
|
||||
* 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} wrapper has been detected.
|
||||
* @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
|
||||
* property.
|
||||
* Return the application property name that can be used to set this property.
|
||||
* @return the application property name
|
||||
* @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
|
||||
* allows the fallback lister to work with any captured output streams in a similar
|
||||
* way to the {@code follow} attribute of the {@code literal Console} appender.
|
||||
* allows the fallback listener to work with any captured output streams in a similar
|
||||
* way to the {@code follow} attribute of the {@code Console} appender.
|
||||
* @param statusLogger the status logger to update
|
||||
*/
|
||||
private void resetFallbackListenerStream(StatusLogger statusLogger) {
|
||||
|
|
|
@ -47,13 +47,13 @@ class DebugLogbackConfigurator extends LogbackConfigurator {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void appender(String name, Appender<?> appender) {
|
||||
void appender(String name, Appender<?> appender) {
|
||||
info("Adding appender '" + appender + "' named '" + name + "'");
|
||||
super.appender(name, appender);
|
||||
}
|
||||
|
||||
@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);
|
||||
if (appender != null) {
|
||||
info("Adding appender '" + appender + "' to logger '" + name + "'");
|
||||
|
@ -62,7 +62,7 @@ class DebugLogbackConfigurator extends LogbackConfigurator {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void start(LifeCycle lifeCycle) {
|
||||
void start(LifeCycle lifeCycle) {
|
||||
info("Starting '" + lifeCycle + "'");
|
||||
super.start(lifeCycle);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ class FilteringStatusListener extends ContextAwareBase implements StatusListener
|
|||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
FilteringStatusListener(StatusListener delegate, int levelThreshold) {
|
||||
|
|
|
@ -52,7 +52,7 @@ class FilteringStatusListenerTests {
|
|||
|
||||
@Test
|
||||
void shouldStartUnderlyingStatusListener() {
|
||||
FilteringStatusListener listener = createListener(Status.INFO);
|
||||
FilteringStatusListener listener = createListener();
|
||||
assertThat(this.delegate.isStarted()).isFalse();
|
||||
listener.start();
|
||||
assertThat(this.delegate.isStarted()).isTrue();
|
||||
|
|
Loading…
Reference in New Issue