Skip to content

Commit 1e5afaf

Browse files
committed
Document spring.test.webtestclient.timeout
Closes gh-46577
1 parent 4f875ad commit 1e5afaf

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
"type": "java.lang.Boolean",
1212
"description": "Whether observability should be auto-configured in tests.",
1313
"defaultValue": false
14+
},
15+
{
16+
"name": "spring.test.webtestclient.timeout",
17+
"type": "java.time.Duration",
18+
"description": "Maximum amount of time to wait for responses.",
19+
"defaultValue": "5s"
1420
}
1521
]
1622
}

spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/WebTestClientAutoConfigurationTests.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ void shouldCustomizeClientCodecs() {
6969
});
7070
}
7171

72+
@Test
73+
void shouldHaveConsistentDefaultTimeout() {
74+
this.contextRunner.withUserConfiguration(BaseConfiguration.class).run((context) -> {
75+
WebTestClient webTestClient = context.getBean(WebTestClient.class);
76+
assertThat(webTestClient).hasFieldOrPropertyWithValue("responseTimeout", Duration.ofSeconds(5));
77+
});
78+
}
79+
7280
@Test
7381
void shouldCustomizeTimeout() {
7482
this.contextRunner.withUserConfiguration(BaseConfiguration.class)

0 commit comments

Comments
 (0)