use of org.springframework.web.testfixture.http.server.reactive.bootstrap.JettyHttpServer in project spring-framework by spring-projects.
the class ErrorHandlerIntegrationTests method emptyPathSegments.
// SPR-15560
@ParameterizedHttpServerTest
void emptyPathSegments(HttpServer httpServer) throws Exception {
startServer(httpServer);
RestTemplate restTemplate = new RestTemplate();
restTemplate.setErrorHandler(NO_OP_ERROR_HANDLER);
URI url = new URI("http://localhost:" + port + "//");
ResponseEntity<String> response = restTemplate.getForEntity(url, String.class);
// Jetty 10+ rejects empty path segments, see https://github.com/eclipse/jetty.project/issues/6302,
// but an application can apply CompactPathRule via RewriteHandler:
// https://www.eclipse.org/jetty/documentation/jetty-11/programming_guide.php
HttpStatus expectedStatus = (httpServer instanceof JettyHttpServer ? HttpStatus.BAD_REQUEST : HttpStatus.OK);
assertThat(response.getStatusCode()).isEqualTo(expectedStatus);
}
use of org.springframework.web.testfixture.http.server.reactive.bootstrap.JettyHttpServer in project spring-framework by spring-projects.
the class AbstractWebSocketIntegrationTests method arguments.
static Stream<Object[]> arguments() throws IOException {
WebSocketClient[] clients = new WebSocketClient[] { new TomcatWebSocketClient(), new JettyWebSocketClient(), new ReactorNettyWebSocketClient(), new UndertowWebSocketClient(Xnio.getInstance().createWorker(OptionMap.EMPTY)) };
Map<HttpServer, Class<?>> servers = new LinkedHashMap<>();
servers.put(new TomcatHttpServer(TMP_DIR.getAbsolutePath(), WsContextListener.class), TomcatConfig.class);
servers.put(new JettyHttpServer(), JettyConfig.class);
servers.put(new ReactorHttpServer(), ReactorNettyConfig.class);
servers.put(new UndertowHttpServer(), UndertowConfig.class);
// Try each client once against each server..
Flux<WebSocketClient> f1 = Flux.fromArray(clients).concatMap(c -> Mono.just(c).repeat(servers.size() - 1));
Flux<Map.Entry<HttpServer, Class<?>>> f2 = Flux.fromIterable(servers.entrySet()).repeat(clients.length - 1).share();
return Flux.zip(f1, f2.map(Map.Entry::getKey), f2.map(Map.Entry::getValue)).map(Tuple3::toArray).toStream();
}
Aggregations