Files
spring-messaging-demo/sse-websocket/src/test/java/com/ankurm/ssews/WebSocketContainerDefaultsTest.java
T
2026-09-04 00:52:18 +05:30

31 lines
1.1 KiB
Java

package com.ankurm.ssews;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.test.web.servlet.client.RestTestClient;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Reads the container's own WebSocket buffer sizes rather than quoting a default from memory.
* Nothing in this application sets them.
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
properties = "dashboard.broadcast.enabled=false")
class WebSocketContainerDefaultsTest {
@LocalServerPort
int port;
@Test
void printThem() {
String body = RestTestClient.bindToServer().baseUrl("http://localhost:" + port).build()
.get().uri("/diag").exchange().expectStatus().isOk()
.expectBody(String.class).returnResult().getResponseBody();
System.out.println("=== /diag with no bigframes profile ===");
System.out.println(body);
assertThat(body).contains("\"ws.container.defaultMaxTextMessageBufferSize\":8192");
}
}