Fix long running test (#18754)

Depending on test exec environment, this test could linger around
for ~8 minutes, b/c pinging test.com will not resolve and run into
seveal timeouts.
This commit is contained in:
Philzen 2024-05-25 08:28:59 +02:00 committed by GitHub
parent 7bc2a66065
commit 746961d07a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -124,9 +124,10 @@ public class GenApiControllerTest {
.andExpect(status().isOk())
.andExpect(header().string(HttpHeaders.CONTENT_LENGTH, not(0)));
}
@Test
public void generateClientWithInvalidOpenAPIUrl() throws Exception {
String invalidOpenAPIUrl = "https://test.com:1234/invalid_openapi.json";
final String invalidOpenAPIUrl = "https://[::1]/invalid_openapi.json";
mockMvc.perform(post("http://test.com:1234/api/gen/clients/java")
.contentType(MediaType.APPLICATION_JSON)
.content("{\"openAPIUrl\": \"" + invalidOpenAPIUrl + "\"}"))