I'm using WebTestClient
to do some integration testing of a controller. If I set a breakpoint inside the controller I hit the standard timeout of 5s of the WebTestClient
. The solution to this is to add @AutoConfigureWebTestClient(timeout = "600000")
to my test as stated her Timeout on blocking read for 5000 MILLISECONDS in Spring WEBFLUX.
For me @AutoConfigureWebTestClient(timeout = "600000")
does not change anything. I still get the timout exception after 5s.
Any ideas what's wrong?
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@ActiveProfiles("test")
@Transactional
@Import(EntityFactoryConfiguration.class)
@AutoConfigureWebTestClient(timeout = "600000") // giv me 10 min for debugging
public class LogControllerIntegrationTest {
...
@Autowired
private WebTestClient webTestClient;
...
@Test
public void myTest() {
...
webTestClient.post().uri("/log")
.contentType(MediaType.APPLICATION_JSON_UTF8)
.accept(MediaType.APPLICATION_JSON_UTF8)
.body(BodyInserters.fromObject(protocolLine))
.exchange()
.expectStatus().isOk();
}