Introduce factory methods in SslInfo and remove MockSslInfo

After further consideration, we have decided to remove the recently
introduced MockSslInfo in favor of introducing the following static
factory methods directly in the SslInfo interface.

- SslInfo.from(String sessionId)

- SslInfo from(String sessionId, X509Certificate... peerCertificates)

See gh-35042
See gh-35078
This commit is contained in:
Sam Brannen
2025-06-19 13:39:31 +02:00
parent 1fb04cb83a
commit f478f5cdc8
3 changed files with 22 additions and 98 deletions
@@ -24,7 +24,7 @@ import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.mock.http.server.reactive.MockSslInfo;
import org.springframework.http.server.reactive.SslInfo;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import org.springframework.test.web.reactive.server.WebTestClient;
import org.springframework.web.bind.annotation.GetMapping;
@@ -65,7 +65,7 @@ class ApplicationContextTests {
@Test // gh-35042
void buildWithSslInfo() {
var client = WebTestClient.bindToApplicationContext(context)
.sslInfo(new MockSslInfo("test123"))
.sslInfo(SslInfo.from("test123"))
.webFilter(new SslSessionIdFilter())
.build();